【模版目录】更新移动端模版
@ -36,7 +36,7 @@
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
<view v-if="item.coupon_time">{{$t(`领取后`)}}{{item.coupon_time}}{{$t(`天内可用`)}}</view>
|
||||
<view v-else>{{ item.start_time ? item.start_time + "-" : ""}}{{ item.end_time }}</view>
|
||||
<view v-else>{{ item.start_use_time ? item.start_use_time + "-" : ""}}{{ item.end_use_time }}</view>
|
||||
<view v-if="coupon.count">
|
||||
<view class='bnt gray' v-if="item.is_use >= item.receive_limit">
|
||||
{{item.use_title || $t(`已领取`)}}</view>
|
||||
|
||||
@ -170,9 +170,10 @@
|
||||
|
||||
/* 转圈 */
|
||||
.spin-circle {
|
||||
background: url('~@/static/easy-loadimage/loading.gif') no-repeat center;
|
||||
background: url('~@/static/easy-loadimage/loading.png') no-repeat center;
|
||||
background-size: 60%;
|
||||
}
|
||||
|
||||
|
||||
/* 动态灰色若隐若现 */
|
||||
.looming-gray {
|
||||
|
||||
@ -67,8 +67,8 @@
|
||||
mixins: [colors],
|
||||
props: {
|
||||
isShow: {
|
||||
type: Number,
|
||||
value: 0
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@ -129,9 +129,8 @@
|
||||
margin-bottom: 8rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
/deep/,
|
||||
justify-content: space-between;
|
||||
|
||||
/deep/image,
|
||||
/deep/.easy-loadimage,
|
||||
/deep/uni-image {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view class="orderGoods">
|
||||
<view class='total' v-if="is_behalf"><text>
|
||||
{{$t(`代付金额`)}}:
|
||||
<text class="pay-price">¥{{pay_price}}</text>
|
||||
<text class="pay-price">¥{{pay_price || 0}}</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class='total' v-else-if="!split && !is_behalf">{{$t(`共`)}}{{totalNmu}}{{$t(`件商品`)}}</view>
|
||||
|
||||
@ -5,11 +5,11 @@
|
||||
:style="{'background-color':newData.bgColor.color[0].item}">
|
||||
<block v-if="item.link == activityTab">
|
||||
<image :src="item.imgList[0]" class="active"></image>
|
||||
<view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">{{item.name}}</view>
|
||||
<view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">{{$t(item.name)}}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image :src="item.imgList[1]"></image>
|
||||
<view class="txt" :style="{color:newData.txtColor.color[0].item}">{{item.name}}</view>
|
||||
<view class="txt" :style="{color:newData.txtColor.color[0].item}">{{$t(item.name)}}</view>
|
||||
</block>
|
||||
<div class="count-num" v-if="item.link === '/pages/order_addcart/order_addcart' && cartNum>0">
|
||||
{{cartNum > 99 ? '99+' : cartNum}}
|
||||
|
||||
@ -1,404 +1,412 @@
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class="product-window"
|
||||
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt?'join':'') + ' ' + (iScart?'joinCart':'')">
|
||||
<view class="textpic acea-row row-between-wrapper">
|
||||
<view class="pictrue" @click="showImg()">
|
||||
<image :src="attr.productSelect.image" ></image>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1">
|
||||
{{ attr.productSelect.store_name }}
|
||||
</view>
|
||||
<view class="money font-color">
|
||||
<view class="acea-row row-middle">
|
||||
{{$t(`¥`)}}<text class="num">{{ attr.productSelect.price }}</text>
|
||||
<text class='vip-money'
|
||||
v-if="is_vip>0 && attr.productSelect.vip_price">{{$t(`¥`)}}{{attr.productSelect.vip_price}}</text>
|
||||
<view class="vipImg" v-if="is_vip>0 && attr.productSelect.vip_price">
|
||||
<image src="../../static/images/svip.gif"></image>
|
||||
</view>
|
||||
</view>
|
||||
<text class="stock" v-if='isShow'>{{$t(`库存`)}}: {{ attr.productSelect.stock }}</text>
|
||||
<text class='stock' v-if="limitNum">{{type ? $t(`库存`) : $t(`限量`)}}: {{attr.productSelect.quota}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="iconfont icon-guanbi" @click="closeAttr"></view>
|
||||
</view>
|
||||
<view class="rollTop">
|
||||
<view class="productWinList">
|
||||
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
||||
<view class="title">{{ $t(item.attr_name) }}</view>
|
||||
<view class="listn acea-row row-middle">
|
||||
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
|
||||
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)"
|
||||
:key="indexn">
|
||||
{{ $t(itemn.attr) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart acea-row row-between-wrapper" v-if="!is_virtual">
|
||||
<view class="title">{{$t(`数量`)}}</view>
|
||||
<view class="carnum acea-row row-left">
|
||||
<view class="item reduce acea-row row-center-wrapper"
|
||||
:class="attr.productSelect.cart_num <= 1 ? 'on' : ''"
|
||||
v-if="attr.productSelect.cart_num <= 1">
|
||||
<text class="iconfont icon-shangpinshuliang-jian"></text>
|
||||
</view>
|
||||
<view class="item reduce acea-row row-center-wrapper"
|
||||
:class="attr.productSelect.cart_num <= 1 ? 'on' : ''" @click="CartNumDes" v-else>
|
||||
<text class="iconfont icon-shangpinshuliang-jian"></text>
|
||||
</view>
|
||||
<view class='item num acea-row row-middle'>
|
||||
<input type="number" v-model="attr.productSelect.cart_num"
|
||||
data-name="productSelect.cart_num"
|
||||
@input="bindCode(attr.productSelect.cart_num)"></input>
|
||||
</view>
|
||||
<view v-if="iSplus" class="item plus acea-row row-center-wrapper" :class="
|
||||
attr.productSelect.cart_num >= attr.productSelect.stock
|
||||
? 'on'
|
||||
: ''
|
||||
" @click="CartNumAdd">
|
||||
<text class="iconfont icon-shangpinshuliang-jia"></text>
|
||||
</view>
|
||||
<view v-else class='item plus'
|
||||
:class='(attr.productSelect.cart_num >= attr.productSelect.quota) || (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (attr.productSelect.cart_num >= attr.productSelect.num) || (type=="seckill" && attr.productSelect.cart_num >= attr.productSelect.once_num)? "on":""'
|
||||
@click='CartNumAdd'>+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="joinBnt bg-color"
|
||||
v-if="iSbnt && attr.productSelect.product_stock>0 &&attr.productSelect.quota>0" @click="goCat">{{$t(`我要参团`)}}
|
||||
</view>
|
||||
<view class="joinBnt on"
|
||||
v-else-if="(iSbnt && attr.productSelect.quota<=0)||(iSbnt &&attr.productSelect.product_stock<=0)">{{$t(`已售罄`)}}
|
||||
</view>
|
||||
<view class="joinBnt bg-color" v-if="iScart && attr.productSelect.stock" @click="goCat">{{$t(`确定`)}}</view>
|
||||
<view class="joinBnt on" v-else-if="iScart && !attr.productSelect.stock">{{$t(`已售罄`)}}</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import colors from "@/mixins/color";
|
||||
export default {
|
||||
mixins: [colors],
|
||||
props: {
|
||||
attr: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
limitNum: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
isShow: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iSbnt: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iSplus: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iScart: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
is_vip: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
is_virtual: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getpreviewImage: function() {
|
||||
uni.previewImage({
|
||||
urls: this.attr.productSelect.image.split(','),
|
||||
current: this.attr.productSelect.image
|
||||
});
|
||||
},
|
||||
goCat: function() {
|
||||
this.$emit('goCat');
|
||||
},
|
||||
/**
|
||||
* 购物车手动输入数量
|
||||
*
|
||||
*/
|
||||
bindCode: function(e) {
|
||||
this.$emit('iptCartNum', this.attr.productSelect.cart_num);
|
||||
},
|
||||
closeAttr: function() {
|
||||
this.$emit('myevent');
|
||||
},
|
||||
CartNumDes: function() {
|
||||
this.$emit('ChangeCartNum', false);
|
||||
},
|
||||
CartNumAdd: function() {
|
||||
this.$emit('ChangeCartNum', true);
|
||||
},
|
||||
tapAttr: function(indexw, indexn) {
|
||||
|
||||
let that = this;
|
||||
that.$emit("attrVal", {
|
||||
indexw: indexw,
|
||||
indexn: indexn
|
||||
});
|
||||
this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attr_values[indexn]);
|
||||
let value = that
|
||||
.getCheckedValue()
|
||||
.join(",");
|
||||
that.$emit("ChangeAttr", value);
|
||||
if(this.limitNum == 1){
|
||||
if(this.attr.productSelect.quota>0){
|
||||
this.attr.productSelect.cart_num = 1
|
||||
}else{
|
||||
this.attr.productSelect.cart_num = 0
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//获取被选中属性;
|
||||
getCheckedValue: function() {
|
||||
let productAttr = this.attr.productAttr;
|
||||
let value = [];
|
||||
for (let i = 0; i < productAttr.length; i++) {
|
||||
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
|
||||
if (productAttr[i].index === productAttr[i].attr_values[j]) {
|
||||
value.push(productAttr[i].attr_values[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},
|
||||
showImg() {
|
||||
this.$emit('getImg');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.vip-money {
|
||||
color: #282828;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.vipImg {
|
||||
width: 68rpx;
|
||||
height: 27rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.product-window {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
z-index: 100;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||
padding-bottom: 140rpx;
|
||||
padding-bottom: calc(140rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||
}
|
||||
|
||||
.product-window.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.product-window.join {
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.product-window.joinCart {
|
||||
padding-bottom: 30rpx;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.product-window .textpic {
|
||||
padding: 0 130rpx 0 30rpx;
|
||||
margin-top: 29rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.product-window .textpic .pictrue {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text {
|
||||
width: 410rpx;
|
||||
font-size: 32rpx;
|
||||
color: #202020;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money {
|
||||
font-size: 24rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money .num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money .stock {
|
||||
color: #999;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .iconfont {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: -5rpx;
|
||||
font-size: 35rpx;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.product-window .rollTop {
|
||||
max-height: 500rpx;
|
||||
overflow: auto;
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item~.item {
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .title {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn {
|
||||
padding: 0 30rpx 0 16rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn {
|
||||
border: 1px solid #F2F2F2;
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
padding: 7rpx 33rpx;
|
||||
border-radius: 25rpx;
|
||||
margin: 20rpx 0 0 14rpx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn.on {
|
||||
color: var(--view-theme);
|
||||
background: var(--view-minorColorT);
|
||||
border-color: var(--view-theme);
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn.limit {
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.product-window .cart {
|
||||
margin-top: 36rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .title {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum {
|
||||
height: 54rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .iconfont {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum view {
|
||||
// border: 1px solid #a4a4a4;
|
||||
width: 84rpx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 54rpx;
|
||||
color: #282828;
|
||||
font-size: 45rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .reduce {
|
||||
border-right: 0;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
line-height: 48rpx;
|
||||
font-size: 60rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .reduce.on {
|
||||
// border-color: #e3e3e3;
|
||||
color: #DEDEDE;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .plus {
|
||||
border-left: 0;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .plus.on {
|
||||
// border-color: #e3e3e3;
|
||||
color: #dedede;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .num {
|
||||
background: rgba(242, 242, 242, 1);
|
||||
color: #282828;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.product-window .joinBnt {
|
||||
font-size: 30rpx;
|
||||
width: 620rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
color: #fff;
|
||||
margin: 21rpx auto 0 auto;
|
||||
}
|
||||
|
||||
.product-window .joinBnt.on {
|
||||
background-color: #bbb;
|
||||
color: #fff;
|
||||
}
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class="product-window"
|
||||
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt?'join':'') + ' ' + (iScart?'joinCart':'')">
|
||||
<view class="textpic acea-row row-between-wrapper">
|
||||
<view class="pictrue" @click="showImg()">
|
||||
<image :src="attr.productSelect.image"></image>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1">
|
||||
{{ attr.productSelect.store_name }}
|
||||
</view>
|
||||
<view class="money font-color">
|
||||
<view class="acea-row row-middle">
|
||||
{{$t(`¥`)}}<text class="num">{{ attr.productSelect.price }}</text>
|
||||
<text class='vip-money'
|
||||
v-if="is_vip>0 && attr.productSelect.vip_price">{{$t(`¥`)}}{{attr.productSelect.vip_price}}</text>
|
||||
<view class="vipImg" v-if="is_vip>0 && attr.productSelect.vip_price">
|
||||
<image src="../../static/images/svip.gif"></image>
|
||||
</view>
|
||||
</view>
|
||||
<text class="stock" v-if='isShow && !type'>{{$t(`库存`)}}: {{ attr.productSelect.stock }}</text>
|
||||
<text class='stock'
|
||||
v-if="limitNum">{{type ? $t(`库存`) : $t(`限量`)}}:{{type ? attr.productSelect.quota : limitNum + unitName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="iconfont icon-guanbi" @click="closeAttr"></view>
|
||||
</view>
|
||||
<view class="rollTop">
|
||||
<view class="productWinList">
|
||||
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
||||
<view class="title">{{ $t(item.attr_name) }}</view>
|
||||
<view class="listn acea-row row-middle">
|
||||
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
|
||||
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)"
|
||||
:key="indexn">
|
||||
{{ $t(itemn.attr) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart acea-row row-between-wrapper" v-if="!is_virtual">
|
||||
<view class="title">{{$t(`数量`)}}</view>
|
||||
<view class="carnum acea-row row-left">
|
||||
<view class="item reduce acea-row row-center-wrapper"
|
||||
:class="attr.productSelect.cart_num <= 1 ? 'on' : ''"
|
||||
v-if="attr.productSelect.cart_num <= 1">
|
||||
<text class="iconfont icon-shangpinshuliang-jian"></text>
|
||||
</view>
|
||||
<view class="item reduce acea-row row-center-wrapper"
|
||||
:class="attr.productSelect.cart_num <= 1 ? 'on' : ''" @click="CartNumDes" v-else>
|
||||
<text class="iconfont icon-shangpinshuliang-jian"></text>
|
||||
</view>
|
||||
<view class='item num acea-row row-middle'>
|
||||
<input type="number" v-model="attr.productSelect.cart_num"
|
||||
data-name="productSelect.cart_num"
|
||||
@input="bindCode(attr.productSelect.cart_num)"></input>
|
||||
</view>
|
||||
<view v-if="iSplus" class="item plus acea-row row-center-wrapper" :class="
|
||||
attr.productSelect.cart_num >= attr.productSelect.stock || (limitNum && attr.productSelect.cart_num >= limitNum)
|
||||
? 'on'
|
||||
: ''
|
||||
" @click="CartNumAdd">
|
||||
<text class="iconfont icon-shangpinshuliang-jia"></text>
|
||||
</view>
|
||||
<view v-else class='item plus'
|
||||
:class='(attr.productSelect.cart_num >= attr.productSelect.quota) || (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (attr.productSelect.cart_num >= attr.productSelect.num) || (type=="seckill" && attr.productSelect.cart_num >= attr.productSelect.once_num) ? "on":""'
|
||||
@click='CartNumAdd'>+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="joinBnt bg-color"
|
||||
v-if="iSbnt && attr.productSelect.product_stock>0 &&attr.productSelect.quota>0" @click="goCat">
|
||||
{{$t(`我要参团`)}}
|
||||
</view>
|
||||
<view class="joinBnt on"
|
||||
v-else-if="(iSbnt && attr.productSelect.quota<=0)||(iSbnt &&attr.productSelect.product_stock<=0)">
|
||||
{{$t(`已售罄`)}}
|
||||
</view>
|
||||
<view class="joinBnt bg-color" v-if="iScart && attr.productSelect.stock" @click="goCat">{{$t(`确定`)}}</view>
|
||||
<view class="joinBnt on" v-else-if="iScart && !attr.productSelect.stock">{{$t(`已售罄`)}}</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import colors from "@/mixins/color";
|
||||
export default {
|
||||
mixins: [colors],
|
||||
props: {
|
||||
attr: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
limitNum: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
isShow: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iSbnt: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iSplus: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
iScart: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
is_vip: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
is_virtual: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
unitName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getpreviewImage: function() {
|
||||
uni.previewImage({
|
||||
urls: this.attr.productSelect.image.split(','),
|
||||
current: this.attr.productSelect.image
|
||||
});
|
||||
},
|
||||
goCat: function() {
|
||||
this.$emit('goCat');
|
||||
},
|
||||
/**
|
||||
* 购物车手动输入数量
|
||||
*
|
||||
*/
|
||||
bindCode: function(e) {
|
||||
this.$emit('iptCartNum', this.attr.productSelect.cart_num);
|
||||
},
|
||||
closeAttr: function() {
|
||||
this.$emit('myevent');
|
||||
},
|
||||
CartNumDes: function() {
|
||||
this.$emit('ChangeCartNum', false);
|
||||
},
|
||||
CartNumAdd: function() {
|
||||
this.$emit('ChangeCartNum', true);
|
||||
},
|
||||
tapAttr: function(indexw, indexn) {
|
||||
|
||||
let that = this;
|
||||
that.$emit("attrVal", {
|
||||
indexw: indexw,
|
||||
indexn: indexn
|
||||
});
|
||||
this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attr_values[indexn]);
|
||||
let value = that
|
||||
.getCheckedValue()
|
||||
.join(",");
|
||||
that.$emit("ChangeAttr", value);
|
||||
if (this.limitNum == 1) {
|
||||
if (this.attr.productSelect.quota > 0) {
|
||||
this.attr.productSelect.cart_num = 1
|
||||
} else {
|
||||
this.attr.productSelect.cart_num = 0
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//获取被选中属性;
|
||||
getCheckedValue: function() {
|
||||
let productAttr = this.attr.productAttr;
|
||||
let value = [];
|
||||
for (let i = 0; i < productAttr.length; i++) {
|
||||
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
|
||||
if (productAttr[i].index === productAttr[i].attr_values[j]) {
|
||||
value.push(productAttr[i].attr_values[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},
|
||||
showImg() {
|
||||
this.$emit('getImg');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.vip-money {
|
||||
color: #282828;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.vipImg {
|
||||
width: 68rpx;
|
||||
height: 27rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.product-window {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
z-index: 100;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||
padding-bottom: 140rpx;
|
||||
padding-bottom: calc(140rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||
}
|
||||
|
||||
.product-window.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.product-window.join {
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.product-window.joinCart {
|
||||
padding-bottom: 30rpx;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.product-window .textpic {
|
||||
padding: 0 130rpx 0 30rpx;
|
||||
margin-top: 29rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.product-window .textpic .pictrue {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text {
|
||||
width: 410rpx;
|
||||
font-size: 32rpx;
|
||||
color: #202020;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money {
|
||||
font-size: 24rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money .num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .text .money .stock {
|
||||
color: #999;
|
||||
margin-left: 6rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.product-window .textpic .iconfont {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: -5rpx;
|
||||
font-size: 35rpx;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.product-window .rollTop {
|
||||
max-height: 500rpx;
|
||||
overflow: auto;
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item~.item {
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .title {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn {
|
||||
padding: 0 30rpx 0 16rpx;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn {
|
||||
border: 1px solid #F2F2F2;
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
padding: 7rpx 33rpx;
|
||||
border-radius: 25rpx;
|
||||
margin: 20rpx 0 0 14rpx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn.on {
|
||||
color: var(--view-theme);
|
||||
background: var(--view-minorColorT);
|
||||
border-color: var(--view-theme);
|
||||
}
|
||||
|
||||
.product-window .productWinList .item .listn .itemn.limit {
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.product-window .cart {
|
||||
margin-top: 36rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .title {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum {
|
||||
height: 54rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .iconfont {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum view {
|
||||
// border: 1px solid #a4a4a4;
|
||||
width: 84rpx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 54rpx;
|
||||
color: #282828;
|
||||
font-size: 45rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .reduce {
|
||||
border-right: 0;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
line-height: 48rpx;
|
||||
font-size: 60rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .reduce.on {
|
||||
// border-color: #e3e3e3;
|
||||
color: #DEDEDE;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .plus {
|
||||
border-left: 0;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .plus.on {
|
||||
// border-color: #e3e3e3;
|
||||
color: #dedede;
|
||||
}
|
||||
|
||||
.product-window .cart .carnum .num {
|
||||
background: rgba(242, 242, 242, 1);
|
||||
color: #282828;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.product-window .joinBnt {
|
||||
font-size: 30rpx;
|
||||
width: 620rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
color: #fff;
|
||||
margin: 21rpx auto 0 auto;
|
||||
}
|
||||
|
||||
.product-window .joinBnt.on {
|
||||
background-color: #bbb;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -185,6 +185,9 @@
|
||||
"desc" : "你的位置信息将用于和门店的距离长度"
|
||||
}
|
||||
},
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"requiredPrivateInfos" : [
|
||||
"getLocation",
|
||||
@ -221,7 +224,8 @@
|
||||
"optimization" : {
|
||||
"treeShaking" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"subPackages" : true
|
||||
},
|
||||
"async" : {
|
||||
"timeout" : 200000
|
||||
@ -233,7 +237,8 @@
|
||||
"immersed" : true
|
||||
}
|
||||
},
|
||||
"_spaceID" : "679f0930-8f60-425c-9033-8c135f397ea5"
|
||||
"_spaceID" : "679f0930-8f60-425c-9033-8c135f397ea5",
|
||||
"lazyCodeLoading" : "requiredComponents"
|
||||
}
|
||||
/* ios打包配置 */
|
||||
|
||||
|
||||
@ -60,10 +60,12 @@ export const sharePoster = {
|
||||
},
|
||||
getImageBase64() {
|
||||
let that = this;
|
||||
imageBase64(that.storeImage, '')
|
||||
imageBase64(that.storeImage, this.storeInfo.wechat_code)
|
||||
.then((res) => {
|
||||
that.storeImageBase64 = res.data.image;
|
||||
// that.PromotionCode = res.data.code;
|
||||
if (this.storeInfo.wechat_code) {
|
||||
that.PromotionCode = res.data.code;
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
@ -158,7 +160,8 @@ export const sharePoster = {
|
||||
that.$set(that, "canvasStatus", true);
|
||||
let arr2
|
||||
// #ifdef MP
|
||||
let met = type === 'scombination' ? scombinationCode(that.id) : type === 'seckill' ? seckillCode(that
|
||||
let met = type === 'scombination' ? scombinationCode(that.id) : type === 'seckill' ? seckillCode(
|
||||
that
|
||||
.id) : getProductCode(that.id)
|
||||
met.then((res) => {
|
||||
uni.downloadFile({
|
||||
@ -186,7 +189,8 @@ export const sharePoster = {
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
arr2 = [that.posterbackgd, that.storeImageBase64, that.PromotionCode];
|
||||
arr2 = [that.posterbackgd, that.storeImageBase64, that.PromotionCode];
|
||||
console.log(arr2)
|
||||
if (!that.storeImageBase64)
|
||||
return that.$util.Tips({
|
||||
title: i18n.t(`正在下载海报,请稍后再试`),
|
||||
|
||||
@ -134,7 +134,8 @@
|
||||
class='iconfont icon-xiangxia'></text></view>
|
||||
<view class='more' @tap='hideAll'
|
||||
v-else-if="pink.length === AllIndex && pink.length !== AllIndexDefault">
|
||||
{{$t(`收起`)}}<text class='iconfont icon-xiangshang'></text></view>
|
||||
{{$t(`收起`)}}<text class='iconfont icon-xiangshang'></text>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class='playWay'>
|
||||
@ -462,7 +463,6 @@
|
||||
});
|
||||
//扫码携带参数处理
|
||||
// #ifdef MP
|
||||
|
||||
if (options.scene) {
|
||||
let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
|
||||
if (value.id) options.id = value.id;
|
||||
@ -509,14 +509,7 @@
|
||||
})
|
||||
}
|
||||
};
|
||||
// #ifdef H5
|
||||
this.codeVal = window.location.origin + '/pages/activity/goods_combination_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.codeVal = HTTP_REQUEST_URL + '/pages/activity/goods_combination_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
this.currentPage = !this.currentPage
|
||||
@ -608,7 +601,7 @@
|
||||
combinationDetail() {
|
||||
var that = this;
|
||||
var data = that.id;
|
||||
getCombinationDetail(data).then(function(res) {
|
||||
getCombinationDetail(data).then((res)=> {
|
||||
that.dataShow = 1;
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.storeInfo.title.substring(0, 16)
|
||||
@ -627,7 +620,20 @@
|
||||
that.replyChance = res.data.replyChance;
|
||||
that.attribute.productAttr = res.data.productAttr;
|
||||
that.productValue = res.data.productValue;
|
||||
// that.PromotionCode = res.data.storeInfo.code_base;
|
||||
if (!this.storeInfo.wechat_code) {
|
||||
// #ifdef H5
|
||||
this.codeVal = window.location.origin +
|
||||
'/pages/activity/goods_combination_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.codeVal = HTTP_REQUEST_URL + '/pages/activity/goods_combination_details/index?id=' +
|
||||
this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
} else {
|
||||
that.$set(that, "PromotionCode", this.storeInfo.wechat_code);
|
||||
}
|
||||
that.routineContact = Number(res.data.routine_contact_type);
|
||||
for (let key in res.data.productValue) {
|
||||
let obj = res.data.productValue[key];
|
||||
@ -658,7 +664,8 @@
|
||||
that.infoScroll();
|
||||
}, 500);
|
||||
|
||||
}).catch(function(err) {
|
||||
}).catch(function(err) {
|
||||
console.log(err)
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
}, {
|
||||
|
||||
@ -560,9 +560,23 @@
|
||||
that.storeImage = that.storeInfo.image
|
||||
that.getImageBase64();
|
||||
// #endif
|
||||
if (!this.storeInfo.wechat_code) {
|
||||
// #ifdef H5
|
||||
this.codeVal = window.location.origin +
|
||||
'/pages/activity/goods_seckill_details/index?id=' +
|
||||
that.id + '&spid=' + that.storeInfo.uid
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.codeVal = HTTP_REQUEST_URL + '/pages/activity/goods_seckill_details/index?id=' +
|
||||
that
|
||||
.id + '&spid=' + that.storeInfo.uid
|
||||
// #endif
|
||||
} else {
|
||||
that.$set(that, "PromotionCode", this.storeInfo.wechat_code);
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
uni.downloadFile({
|
||||
url: that.setDomain(res.data.storeInfo.code_base),
|
||||
url: that.setDomain(res.data.storeInfo.wechat_code),
|
||||
success: function(res) {
|
||||
that.PromotionCode = res.tempFilePath;
|
||||
},
|
||||
@ -572,7 +586,8 @@
|
||||
});
|
||||
},
|
||||
});
|
||||
// that.PromotionCode = res.data.storeInfo.code_base
|
||||
|
||||
|
||||
that.downloadFilestoreImage();
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
@ -586,14 +601,7 @@
|
||||
setTimeout(() => {
|
||||
that.infoScroll();
|
||||
}, 500);
|
||||
// #ifdef H5
|
||||
this.codeVal = window.location.origin + '/pages/activity/goods_seckill_details/index?id=' +
|
||||
that.id + '&spid=' + that.storeInfo.uid
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.codeVal = HTTP_REQUEST_URL + '/pages/activity/goods_seckill_details/index?id=' + that
|
||||
.id + '&spid=' + that.storeInfo.uid
|
||||
// #endif
|
||||
|
||||
app.globalData.openPages = '/pages/activity/goods_seckill_details/index?id=' + that.id +
|
||||
'&spid=' + that.storeInfo.uid;
|
||||
// wxParse.wxParse('description', 'html', that.data.storeInfo.description || '', that, 0);
|
||||
|
||||
@ -1,431 +1,430 @@
|
||||
<template>
|
||||
<view class="posterCon" :style="colorStyle">
|
||||
<view class='poster-poster'>
|
||||
<view class='tip'><text class='iconfont icon-shuoming'></text>{{$t(`提示:点击图片即可保存至手机相册`)}}</view>
|
||||
<view class='pictrue'>
|
||||
<!-- <image :src='image' mode="widthFix"></image> -->
|
||||
<image class="canvas" :src="posterImage" v-if="posterImage" @click="savePosterPathMp(posterImage)">
|
||||
</image>
|
||||
<canvas class="canvas" canvas-id="myCanvas" v-else></canvas>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef H5 || APP-PLUS -->
|
||||
<zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="val" :size="size" :unit="unit" :background="background"
|
||||
:foreground="foreground" :pdground="pdground" :icon="icon" :iconSize="iconsize" :onval="onval"
|
||||
:loadMake="loadMake" @result="qrR" />
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import zbCode from '@/components/zb-code/zb-code.vue'
|
||||
import {
|
||||
getBargainPoster,
|
||||
getCombinationPoster,
|
||||
getBargainPosterData,
|
||||
getCombinationPosterData
|
||||
} from '@/api/activity.js';
|
||||
import {
|
||||
getUserInfo,
|
||||
imgToBase,
|
||||
routineCode
|
||||
} from '@/api/user.js';
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
TOKENNAME,
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app.js';
|
||||
// #endif
|
||||
import colors from '@/mixins/color.js'
|
||||
export default {
|
||||
components: {
|
||||
zbCode
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
canvasStatus: true,
|
||||
posterImage: "",
|
||||
parameter: {
|
||||
'navbar': '1',
|
||||
'return': '1',
|
||||
'title': this.$t(`拼团海报`),
|
||||
'color': true,
|
||||
'class': '0'
|
||||
},
|
||||
type: 0,
|
||||
id: 0,
|
||||
bargain: 0,
|
||||
image: '',
|
||||
from: '',
|
||||
uid: "",
|
||||
//二维码参数
|
||||
codeShow: false,
|
||||
cid: '1',
|
||||
ifShow: true,
|
||||
val: "", // 要生成的二维码值
|
||||
size: 200, // 二维码大小
|
||||
unit: 'upx', // 单位
|
||||
background: '#FFF', // 背景色
|
||||
foreground: '#000', // 前景色
|
||||
pdground: '#000', // 角标色
|
||||
icon: '', // 二维码图标
|
||||
iconsize: 40, // 二维码图标大小
|
||||
lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
|
||||
onval: true, // val值变化时自动重新生成二维码
|
||||
loadMake: true, // 组件加载完成后自动生成二维码
|
||||
src: '', // 二维码生成后的图片地址或base64
|
||||
codeSrc: "",
|
||||
wd: 0,
|
||||
hg: 0,
|
||||
posterBag: "../static/posterBag.png",
|
||||
mpUrl: "",
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// #ifdef MP
|
||||
this.from = 'routine'
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
this.from = 'wechat'
|
||||
// #endif
|
||||
|
||||
var that = this;
|
||||
if (options.hasOwnProperty('type') && options.hasOwnProperty('id')) {
|
||||
this.type = options.type
|
||||
this.id = options.id
|
||||
if (options.type == 1) {
|
||||
this.bargain = options.bargain
|
||||
uni.setNavigationBarTitle({
|
||||
title: that.$t(`砍价海报`)
|
||||
})
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: that.$t(`拼团海报`)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return app.Tips({
|
||||
title: that.$t(`参数错误`),
|
||||
icon: 'none'
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef H5
|
||||
if (this.type == 1) {
|
||||
this.val = window.location.origin + '/pages/activity/goods_bargain_details/index?id=' + this.id +
|
||||
'&bargain=' +
|
||||
this.$store.state.app.uid +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
} else if (this.type == 2) {
|
||||
this.val = window.location.origin + '/pages/activity/goods_combination_status/index?id=' + this.id +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
if (this.type == 1) {
|
||||
this.val = HTTP_REQUEST_URL + '/pages/activity/goods_bargain_details/index?id=' + this.id + '&bargain=' +
|
||||
this.$store.state.app.uid +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
} else if (this.type == 2) {
|
||||
this.val = HTTP_REQUEST_URL + '/pages/activity/goods_combination_status/index?id=' + this.id +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
}
|
||||
|
||||
// #endif
|
||||
setTimeout(e => {
|
||||
this.getPosterInfo();
|
||||
}, 200)
|
||||
this.$nextTick(function() {
|
||||
let selector = uni.createSelectorQuery().select('.pictrue');
|
||||
selector.fields({
|
||||
size: true
|
||||
}, data => {
|
||||
this.wd = data.width
|
||||
this.hg = data.height
|
||||
}).exec();
|
||||
})
|
||||
this.routineCode()
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
async getPosterInfo() {
|
||||
var that = this,
|
||||
url = '';
|
||||
let data = {
|
||||
id: that.id,
|
||||
'from': that.from
|
||||
};
|
||||
let userData = await getUserInfo()
|
||||
this.uid = userData.data.uid
|
||||
let goods_img, mp_code, resData, arr, mpUrl
|
||||
// #ifdef MP
|
||||
// #endif
|
||||
uni.showLoading({
|
||||
title: that.$t(`海报生成中`),
|
||||
mask: true
|
||||
});
|
||||
if (that.type == 1) {
|
||||
await getBargainPosterData(that.id).then(res => {
|
||||
resData = res.data
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`海报图片获取失败`)
|
||||
});
|
||||
return
|
||||
})
|
||||
} else {
|
||||
await getCombinationPosterData(that.id).then(res => {
|
||||
resData = res.data
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`海报图片获取失败`)
|
||||
});
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef H5 || APP-PLUS
|
||||
goods_img = await this.imgToBase(resData.image)
|
||||
mp_code = await this.imgToBase(resData.url)
|
||||
arr = [this.posterBag, goods_img, mp_code || this.codeSrc]
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
mpUrl = resData.url ? await this.downloadFilestoreImage(resData.url) : await this
|
||||
.downloadFilestoreImage(this.mpUrl)
|
||||
arr = [this.posterBag, await this.downloadFilestoreImage(resData.image), mpUrl]
|
||||
// #endif
|
||||
this.$nextTick((e) => {
|
||||
that.$util.bargainPosterCanvas(arr, resData.title, resData.label, resData.msg, resData
|
||||
.price,
|
||||
this.wd,
|
||||
this.hg,
|
||||
(tempFilePath) => {
|
||||
this.posterImage = tempFilePath
|
||||
});
|
||||
})
|
||||
},
|
||||
async routineCode() {
|
||||
let res = await routineCode()
|
||||
this.mpUrl = res.data.url
|
||||
},
|
||||
//图片转符合安全域名路径
|
||||
downloadFilestoreImage(url) {
|
||||
url = this.setDomain(url)
|
||||
return new Promise((resolve, reject) => {
|
||||
let that = this;
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: function(res) {
|
||||
resolve(res.tempFilePath);
|
||||
},
|
||||
fail: function() {
|
||||
return that.$util.Tips({
|
||||
title: ''
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
//替换安全域名
|
||||
setDomain: function(url) {
|
||||
url = url ? url.toString() : '';
|
||||
//本地调试打开,生产请注销
|
||||
if (url.indexOf('https://') > -1) return url;
|
||||
else return url.replace('http://', 'https://');
|
||||
},
|
||||
async imgToBase(url) {
|
||||
let res = await imgToBase({
|
||||
image: url
|
||||
})
|
||||
|
||||
return res.data.image
|
||||
},
|
||||
downloadImg() {
|
||||
|
||||
},
|
||||
savePosterPathMp(url) {
|
||||
let that = this;
|
||||
// #ifdef APP-PLUS
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: url,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: url,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`enable_file_access`)
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: url,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// 创建隐藏的可下载链接
|
||||
var eleLink = document.createElement('a');
|
||||
eleLink.download = that.$t(`海报`);
|
||||
eleLink.href = url;
|
||||
// 触发点击
|
||||
document.body.appendChild(eleLink);
|
||||
eleLink.click();
|
||||
// #endif
|
||||
},
|
||||
qrR(res) {
|
||||
this.codeSrc = res
|
||||
},
|
||||
// #ifdef MP
|
||||
savePosterPath: function() {
|
||||
let that = this;
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.posterImage,
|
||||
success: function(res) {
|
||||
that.posterImageClose();
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.posterImage,
|
||||
success: function(res) {
|
||||
that.posterImageClose();
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.posterCon {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
background-color: var(--view-theme);
|
||||
bottom: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.poster-poster .tip {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #e8c787;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.poster-poster .tip .iconfont {
|
||||
font-size: 36rpx;
|
||||
vertical-align: -4rpx;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
|
||||
.canvas {
|
||||
width: 100%;
|
||||
height: 1100rpx;
|
||||
}
|
||||
|
||||
.poster-poster .pictrue {
|
||||
width: 700rpx;
|
||||
/* height: 100%; */
|
||||
margin: 0 auto 50rpx auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.poster-poster .pictrue image {
|
||||
width: 100%;
|
||||
/* height: 100%; */
|
||||
|
||||
}
|
||||
<template>
|
||||
<view class="posterCon" :style="colorStyle">
|
||||
<view class='poster-poster'>
|
||||
<view class='tip'><text class='iconfont icon-shuoming'></text>{{$t(`提示:点击图片即可保存至手机相册`)}}</view>
|
||||
<view class='pictrue'>
|
||||
<!-- <image :src='image' mode="widthFix"></image> -->
|
||||
<image class="canvas" :src="posterImage" v-if="posterImage" @click="savePosterPathMp(posterImage)">
|
||||
</image>
|
||||
<canvas class="canvas" canvas-id="myCanvas" v-else></canvas>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef H5 || APP-PLUS -->
|
||||
<zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="val" :size="size" :unit="unit" :background="background"
|
||||
:foreground="foreground" :pdground="pdground" :icon="icon" :iconSize="iconsize" :onval="onval"
|
||||
:loadMake="loadMake" @result="qrR" />
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import zbCode from '@/components/zb-code/zb-code.vue'
|
||||
import {
|
||||
getBargainPoster,
|
||||
getCombinationPoster,
|
||||
getBargainPosterData,
|
||||
getCombinationPosterData
|
||||
} from '@/api/activity.js';
|
||||
import {
|
||||
getUserInfo,
|
||||
imgToBase,
|
||||
routineCode
|
||||
} from '@/api/user.js';
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
TOKENNAME,
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app.js';
|
||||
// #endif
|
||||
import colors from '@/mixins/color.js'
|
||||
export default {
|
||||
components: {
|
||||
zbCode
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
canvasStatus: true,
|
||||
posterImage: "",
|
||||
parameter: {
|
||||
'navbar': '1',
|
||||
'return': '1',
|
||||
'title': this.$t(`拼团海报`),
|
||||
'color': true,
|
||||
'class': '0'
|
||||
},
|
||||
type: 0,
|
||||
id: 0,
|
||||
bargain: 0,
|
||||
image: '',
|
||||
from: '',
|
||||
uid: "",
|
||||
//二维码参数
|
||||
codeShow: false,
|
||||
cid: '1',
|
||||
ifShow: true,
|
||||
val: "", // 要生成的二维码值
|
||||
size: 200, // 二维码大小
|
||||
unit: 'upx', // 单位
|
||||
background: '#FFF', // 背景色
|
||||
foreground: '#000', // 前景色
|
||||
pdground: '#000', // 角标色
|
||||
icon: '', // 二维码图标
|
||||
iconsize: 40, // 二维码图标大小
|
||||
lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
|
||||
onval: true, // val值变化时自动重新生成二维码
|
||||
loadMake: true, // 组件加载完成后自动生成二维码
|
||||
src: '', // 二维码生成后的图片地址或base64
|
||||
codeSrc: "",
|
||||
wd: 0,
|
||||
hg: 0,
|
||||
posterBag: "../static/posterBag.png",
|
||||
mpUrl: "",
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// #ifdef MP
|
||||
this.from = 'routine'
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
this.from = 'wechat'
|
||||
// #endif
|
||||
|
||||
var that = this;
|
||||
if (options.hasOwnProperty('type') && options.hasOwnProperty('id')) {
|
||||
this.type = options.type
|
||||
this.id = options.id
|
||||
if (options.type == 1) {
|
||||
this.bargain = options.bargain
|
||||
uni.setNavigationBarTitle({
|
||||
title: that.$t(`砍价海报`)
|
||||
})
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: that.$t(`拼团海报`)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return app.Tips({
|
||||
title: that.$t(`参数错误`),
|
||||
icon: 'none'
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef H5
|
||||
if (this.type == 1) {
|
||||
this.val = window.location.origin + '/pages/activity/goods_bargain_details/index?id=' + this.id +
|
||||
'&bargain=' +
|
||||
this.$store.state.app.uid +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
} else if (this.type == 2) {
|
||||
this.val = window.location.origin + '/pages/activity/goods_combination_status/index?id=' + this.id +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
if (this.type == 1) {
|
||||
this.val = HTTP_REQUEST_URL + '/pages/activity/goods_bargain_details/index?id=' + this.id + '&bargain=' +
|
||||
this.$store.state.app.uid +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
} else if (this.type == 2) {
|
||||
this.val = HTTP_REQUEST_URL + '/pages/activity/goods_combination_status/index?id=' + this.id +
|
||||
'&spread=' +
|
||||
this.$store.state.app.uid
|
||||
}
|
||||
// #endif
|
||||
setTimeout(e => {
|
||||
this.getPosterInfo();
|
||||
}, 200)
|
||||
this.$nextTick(function() {
|
||||
let selector = uni.createSelectorQuery().select('.pictrue');
|
||||
selector.fields({
|
||||
size: true
|
||||
}, data => {
|
||||
this.wd = data.width
|
||||
this.hg = data.height
|
||||
}).exec();
|
||||
})
|
||||
this.routineCode()
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
async getPosterInfo() {
|
||||
var that = this,
|
||||
url = '';
|
||||
let data = {
|
||||
id: that.id,
|
||||
'from': that.from
|
||||
};
|
||||
let userData = await getUserInfo()
|
||||
this.uid = userData.data.uid
|
||||
let goods_img, mp_code, resData, arr, mpUrl
|
||||
// #ifdef MP
|
||||
// #endif
|
||||
uni.showLoading({
|
||||
title: that.$t(`海报生成中`),
|
||||
mask: true
|
||||
});
|
||||
if (that.type == 1) {
|
||||
await getBargainPosterData(that.id).then(res => {
|
||||
resData = res.data
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`海报图片获取失败`)
|
||||
});
|
||||
return
|
||||
})
|
||||
} else {
|
||||
await getCombinationPosterData(that.id).then(res => {
|
||||
resData = res.data
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`海报图片获取失败`)
|
||||
});
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef H5 || APP-PLUS
|
||||
let imgData = await this.imgToBase(resData.image, resData.url)
|
||||
arr = [this.posterBag, imgData.image, imgData.code || this.codeSrc]
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
mpUrl = resData.url ? await this.downloadFilestoreImage(resData.url) : await this
|
||||
.downloadFilestoreImage(this.mpUrl)
|
||||
arr = [this.posterBag, await this.downloadFilestoreImage(resData.image), mpUrl]
|
||||
// #endif
|
||||
this.$nextTick((e) => {
|
||||
that.$util.bargainPosterCanvas(arr, resData.title, resData.label, resData.msg, resData
|
||||
.price,
|
||||
this.wd,
|
||||
this.hg,
|
||||
(tempFilePath) => {
|
||||
this.posterImage = tempFilePath
|
||||
});
|
||||
})
|
||||
},
|
||||
async routineCode() {
|
||||
let res = await routineCode()
|
||||
this.mpUrl = res.data.url
|
||||
},
|
||||
//图片转符合安全域名路径
|
||||
downloadFilestoreImage(url) {
|
||||
url = this.setDomain(url)
|
||||
return new Promise((resolve, reject) => {
|
||||
let that = this;
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: function(res) {
|
||||
resolve(res.tempFilePath);
|
||||
},
|
||||
fail: function() {
|
||||
return that.$util.Tips({
|
||||
title: ''
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
//替换安全域名
|
||||
setDomain: function(image, url) {
|
||||
url = url ? url.toString() : '';
|
||||
//本地调试打开,生产请注销
|
||||
if (url.indexOf('https://') > -1) return url;
|
||||
else return url.replace('http://', 'https://');
|
||||
},
|
||||
async imgToBase(image, url) {
|
||||
let res = await imgToBase({
|
||||
image: image,
|
||||
code: url
|
||||
})
|
||||
|
||||
return res.data
|
||||
},
|
||||
downloadImg() {
|
||||
|
||||
},
|
||||
savePosterPathMp(url) {
|
||||
let that = this;
|
||||
// #ifdef APP-PLUS
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: url,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: url,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`enable_file_access`)
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: url,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// 创建隐藏的可下载链接
|
||||
var eleLink = document.createElement('a');
|
||||
eleLink.download = that.$t(`海报`);
|
||||
eleLink.href = url;
|
||||
// 触发点击
|
||||
document.body.appendChild(eleLink);
|
||||
eleLink.click();
|
||||
// #endif
|
||||
},
|
||||
qrR(res) {
|
||||
this.codeSrc = res
|
||||
},
|
||||
// #ifdef MP
|
||||
savePosterPath: function() {
|
||||
let that = this;
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.posterImage,
|
||||
success: function(res) {
|
||||
that.posterImageClose();
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.posterImage,
|
||||
success: function(res) {
|
||||
that.posterImageClose();
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`保存失败`)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.posterCon {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
background-color: var(--view-theme);
|
||||
bottom: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.poster-poster .tip {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #e8c787;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.poster-poster .tip .iconfont {
|
||||
font-size: 36rpx;
|
||||
vertical-align: -4rpx;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
|
||||
.canvas {
|
||||
width: 100%;
|
||||
height: 1100rpx;
|
||||
}
|
||||
|
||||
.poster-poster .pictrue {
|
||||
width: 700rpx;
|
||||
/* height: 100%; */
|
||||
margin: 0 auto 50rpx auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.poster-poster .pictrue image {
|
||||
width: 100%;
|
||||
/* height: 100%; */
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,167 +1,232 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="priceChange" :class="change === true ? 'on' : ''">
|
||||
<view class="priceTitle">
|
||||
{{ status == 0 ? $t(`一键改价`) : status == 1 ? $t(`订单备注`) : $t(`立即退款`) }}
|
||||
<span class="iconfont icon-guanbi" @click="close"></span>
|
||||
</view>
|
||||
<view class="listChange" v-if="status == 0 || status == 2">
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-if="orderInfo.refund_status === 0"
|
||||
>
|
||||
<view>{{$t(`商品总价`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
{{ orderInfo.total_price }}<span class="iconfont icon-suozi"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-if="orderInfo.refund_status === 0"
|
||||
>
|
||||
<view>{{$t(`原始邮费`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
{{ orderInfo.pay_postage }}<span class="iconfont icon-suozi"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-if="orderInfo.refund_status === 0"
|
||||
>
|
||||
<view>{{$t(`实际支付`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
<input
|
||||
type="text"
|
||||
v-model="price"
|
||||
:class="focus === true ? 'on' : ''"
|
||||
@focus="priceChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-if="orderInfo.refund_status === 1"
|
||||
>
|
||||
<view>{{$t(`实际支付`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
{{ orderInfo.pay_price }}<span class="iconfont icon-suozi"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-if="orderInfo.refund_status === 1"
|
||||
>
|
||||
<view>{{$t(`退款金额`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
<input
|
||||
type="text"
|
||||
v-model="refund_price"
|
||||
:class="focus === true ? 'on' : ''"
|
||||
@focus="priceChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listChange" v-else>
|
||||
<textarea
|
||||
:placeholder="
|
||||
orderInfo.remark ? orderInfo.remark : $t(`请填写备注信息`)
|
||||
"
|
||||
v-model="remark"
|
||||
></textarea>
|
||||
</view>
|
||||
<view class="modify" @click="save">
|
||||
{{
|
||||
status == 1 || orderInfo.refund_status == 0 ? $t(`立即修改`) : $t(`确认退款`)
|
||||
}}
|
||||
</view>
|
||||
<view
|
||||
class="modify1"
|
||||
@click="refuse"
|
||||
v-if="orderInfo.refund_status == 1 && status == 0"
|
||||
>
|
||||
{{$t(`拒绝退款`)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent v-show="change === true"></view>
|
||||
</view>
|
||||
</template>
|
||||
<template>
|
||||
<view>
|
||||
<view class="priceChange" :class="change === true ? 'on' : ''">
|
||||
<view class="priceTitle">
|
||||
{{ status == 0 ? $t(`一键改价`) : status == 1 ? $t(`订单备注`) : $t(`立即退款`) }}
|
||||
<span class="iconfont icon-guanbi" @click="close"></span>
|
||||
</view>
|
||||
<view class="listChange" v-if="status == 0 || status == 2">
|
||||
<view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 0">
|
||||
<view>{{$t(`商品总价`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
{{ orderInfo.total_price }}<span class="iconfont icon-suozi"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 0">
|
||||
<view>{{$t(`原始邮费`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
{{ orderInfo.pay_postage }}<span class="iconfont icon-suozi"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 0">
|
||||
<view>{{$t(`实际支付`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
<input type="text" v-model="price" :class="focus === true ? 'on' : ''" @focus="priceChange" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 1">
|
||||
<view>{{$t(`实际支付`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
{{ orderInfo.pay_price }}<span class="iconfont icon-suozi"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 1">
|
||||
<view>{{$t(`退款金额`)}}({{$t(`¥`)}})</view>
|
||||
<view class="money">
|
||||
<input type="text" v-model="refund_price" :class="focus === true ? 'on' : ''"
|
||||
@focus="priceChange" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listChange" v-else>
|
||||
<textarea class="pd10" :placeholder="
|
||||
orderInfo.remark ? orderInfo.remark : $t(`请填写备注信息`)
|
||||
" v-model="remark"></textarea>
|
||||
</view>
|
||||
<view class="modify" @click="save">
|
||||
{{
|
||||
status == 1 || orderInfo.refund_status == 0 ? $t(`立即修改`) : $t(`确认退款`)
|
||||
}}
|
||||
</view>
|
||||
<view class="modify1" @click="refuse" v-if="orderInfo.refund_status == 1 && status == 0">
|
||||
{{$t(`拒绝退款`)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent v-show="change === true"></view>
|
||||
</view>
|
||||
</template>
|
||||
<style>
|
||||
.priceChange{position:fixed;width:580upx;height:670upx;background-color:#fff;border-radius:10upx;top:50%;left:50%;margin-left:-290upx;margin-top:-335upx;z-index:666;transition:all 0.3s ease-in-out 0s;transform: scale(0);opacity:0;}
|
||||
.priceChange.on{opacity:1;transform: scale(1);}
|
||||
.priceChange .priceTitle{background:url("../../static/pricetitle.jpg") no-repeat;background-size:100% 100%;width:100%;height:160upx;border-radius:10upx 10upx 0 0;text-align:center;font-size:40upx;color:#fff;line-height:160upx;position:relative;}
|
||||
.priceChange .priceTitle .iconfont{position:absolute;font-size:40upx;right:26upx;top:23upx;width:40upx;height:40upx;line-height:40upx;}
|
||||
.priceChange .listChange{ width: 100%; padding:0 20rpx;}
|
||||
.priceChange .listChange textarea{box-sizing: border-box;}
|
||||
.priceChange .listChange .item{height:103upx;border-bottom:1px solid #e3e3e3;font-size:32upx;color:#333;}
|
||||
.priceChange .listChange .item .money{color:#666;width:300upx;text-align:right;}
|
||||
.priceChange .listChange .item .money .iconfont{font-size:32upx;margin-left:20upx;}
|
||||
.priceChange .listChange .item .money input{width:100%;height:100%;text-align:right;color:#ccc;}
|
||||
.priceChange .listChange .item .money input.on{color:#666;}
|
||||
.priceChange .modify{font-size:32upx;color:#fff;width:490upx;height:90upx;text-align:center;line-height:90upx;border-radius:45upx;background-color:#2291f8;margin:53upx auto 0 auto;}
|
||||
.priceChange .modify1{font-size:32upx;color:#312b2b;width:490upx;height:90upx;text-align:center;line-height:90upx;border-radius:45upx;background-color:#eee;margin:30upx auto 0 auto;}
|
||||
.priceChange .listChange textarea {
|
||||
border: 1px solid #eee;
|
||||
width: 100%;
|
||||
height: 200upx;
|
||||
margin-top: 50upx;
|
||||
border-radius: 10upx;
|
||||
color: #333;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
name: "PriceChange",
|
||||
components: {},
|
||||
props: {
|
||||
change: Boolean,
|
||||
orderInfo: Object,
|
||||
status: String
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
focus: false,
|
||||
price: 0,
|
||||
refund_price: 0,
|
||||
remark: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
orderInfo: function(nVal) {
|
||||
this.price = this.orderInfo.pay_price;
|
||||
this.refund_price = this.orderInfo.pay_price;
|
||||
this.remark = "";
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
},
|
||||
methods: {
|
||||
priceChange: function() {
|
||||
this.focus = true;
|
||||
},
|
||||
close: function() {
|
||||
this.price = this.orderInfo.pay_price;
|
||||
this.$emit("closechange", false);
|
||||
},
|
||||
save: function() {
|
||||
let that = this;
|
||||
that.$emit("savePrice", {
|
||||
price: that.price,
|
||||
refund_price: that.refund_price,
|
||||
type: 1,
|
||||
remark: that.remark
|
||||
});
|
||||
},
|
||||
refuse: function() {
|
||||
let that = this;
|
||||
that.$emit("savePrice", {
|
||||
price: that.price,
|
||||
refund_price: that.refund_price,
|
||||
type: 2,
|
||||
remark: that.remark
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
.mask{
|
||||
z-index: 99;
|
||||
}
|
||||
.priceChange {
|
||||
position: fixed;
|
||||
width: 580upx;
|
||||
/* height: 670upx; */
|
||||
padding-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10upx;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -290upx;
|
||||
margin-top: -335upx;
|
||||
z-index: 666;
|
||||
transition: all 0.3s ease-in-out 0s;
|
||||
transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.priceChange.on {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.priceChange .priceTitle {
|
||||
background: url("../../static/pricetitle.jpg") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
width: 100%;
|
||||
height: 160upx;
|
||||
border-radius: 10upx 10upx 0 0;
|
||||
text-align: center;
|
||||
font-size: 40upx;
|
||||
color: #fff;
|
||||
line-height: 160upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.priceChange .priceTitle .iconfont {
|
||||
position: absolute;
|
||||
font-size: 40upx;
|
||||
right: 26upx;
|
||||
top: 23upx;
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
line-height: 40upx;
|
||||
}
|
||||
|
||||
.priceChange .listChange {
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.priceChange .listChange textarea {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.priceChange .listChange .item {
|
||||
height: 103upx;
|
||||
border-bottom: 1px solid #e3e3e3;
|
||||
font-size: 32upx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.priceChange .listChange .item .money {
|
||||
color: #666;
|
||||
width: 300upx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.priceChange .listChange .item .money .iconfont {
|
||||
font-size: 32upx;
|
||||
margin-left: 20upx;
|
||||
}
|
||||
|
||||
.priceChange .listChange .item .money input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: right;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.priceChange .listChange .item .money input.on {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.priceChange .modify {
|
||||
font-size: 32upx;
|
||||
color: #fff;
|
||||
width: 490upx;
|
||||
height: 90upx;
|
||||
text-align: center;
|
||||
line-height: 90upx;
|
||||
border-radius: 45upx;
|
||||
background-color: #2291f8;
|
||||
margin: 53upx auto 0 auto;
|
||||
}
|
||||
|
||||
.priceChange .modify1 {
|
||||
font-size: 32upx;
|
||||
color: #312b2b;
|
||||
width: 490upx;
|
||||
height: 90upx;
|
||||
text-align: center;
|
||||
line-height: 90upx;
|
||||
border-radius: 45upx;
|
||||
background-color: #eee;
|
||||
margin: 30upx auto 0 auto;
|
||||
}
|
||||
|
||||
.priceChange .listChange textarea {
|
||||
border: 1px solid #eee;
|
||||
width: 100%;
|
||||
height: 200upx;
|
||||
margin-top: 50upx;
|
||||
border-radius: 10upx;
|
||||
color: #333;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
name: "PriceChange",
|
||||
components: {},
|
||||
props: {
|
||||
change: Boolean,
|
||||
orderInfo: Object,
|
||||
status: String
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
focus: false,
|
||||
price: 0,
|
||||
refund_price: 0,
|
||||
remark: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
orderInfo: function(nVal) {
|
||||
this.price = this.orderInfo.pay_price;
|
||||
this.refund_price = this.orderInfo.pay_price;
|
||||
this.remark = "";
|
||||
}
|
||||
},
|
||||
mounted: function() {},
|
||||
methods: {
|
||||
priceChange: function() {
|
||||
this.focus = true;
|
||||
},
|
||||
close: function() {
|
||||
this.price = this.orderInfo.pay_price;
|
||||
this.$emit("closechange", false);
|
||||
},
|
||||
save: function() {
|
||||
let that = this;
|
||||
that.$emit("savePrice", {
|
||||
price: that.price,
|
||||
refund_price: that.refund_price,
|
||||
type: 1,
|
||||
remark: that.remark
|
||||
});
|
||||
},
|
||||
refuse: function() {
|
||||
let that = this;
|
||||
that.$emit("savePrice", {
|
||||
price: that.price,
|
||||
refund_price: that.refund_price,
|
||||
type: 2,
|
||||
remark: that.remark
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -81,7 +81,7 @@
|
||||
range-key="title">
|
||||
<view class="uni-input">{{expTemp[expIndex].title}}</view>
|
||||
</picker>
|
||||
<div class="look" @click="previewImage">{{$t(`preview`)}}</div>
|
||||
<div class="look" @click="previewImage">{{$t(`预览`)}}</div>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
|
||||
@ -57,14 +57,14 @@
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="public-total">
|
||||
<view class="public-total" v-if="orderInfo.total_num">
|
||||
{{$t(`共`)}}{{ orderInfo.total_num }}{{$t(`件商品,应支付`)}}
|
||||
<span class="money">{{$t(`¥`)}}{{ orderInfo.pay_price }}</span> ( {{$t(`邮费`)}} {{$t(`¥`)}}{{
|
||||
orderInfo.pay_postage
|
||||
}}
|
||||
)
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="wrapper" v-if="orderInfo.order_id">
|
||||
<view class="item acea-row row-between">
|
||||
<view>{{$t(`订单编号`)}}:</view>
|
||||
<view class="conter acea-row row-middle row-right">
|
||||
@ -112,18 +112,18 @@
|
||||
<view class="wrapper">
|
||||
<view class="item acea-row row-between">
|
||||
<view>{{$t(`支付金额`)}}:</view>
|
||||
<view class="conter">{{$t(`¥`)}}{{ orderInfo.total_price }}</view>
|
||||
<view class="conter">{{$t(`¥`)}}{{ orderInfo.total_price || 0 }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>{{$t(`优惠券抵扣`)}}:</view>
|
||||
<view class="conter">-{{$t(`¥`)}}{{ orderInfo.coupon_price }}</view>
|
||||
<view class="conter">-{{$t(`¥`)}}{{ orderInfo.coupon_price || 0 }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>{{$t(`运费`)}}:</view>
|
||||
<view class="conter">{{$t(`¥`)}}{{ orderInfo.pay_postage }}</view>
|
||||
<view class="conter">{{$t(`¥`)}}{{ orderInfo.pay_postage || 0 }}</view>
|
||||
</view>
|
||||
<view class="actualPay acea-row row-right">
|
||||
{{$t(`实付款`)}}:<span class="money">{{$t(`¥`)}}{{ orderInfo.pay_price }}</span>
|
||||
{{$t(`实付款`)}}:<span class="money">{{$t(`¥`)}}{{ orderInfo.pay_price || 0 }}</span>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -378,7 +378,7 @@
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
z-index: 99;
|
||||
.input {
|
||||
width: 598rpx;
|
||||
background-color: #f7f7f7;
|
||||
@ -422,7 +422,7 @@
|
||||
position: fixed;
|
||||
top: 96rpx;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.pos-order-list .nav .item.on {
|
||||
@ -476,7 +476,9 @@
|
||||
|
||||
.pos-order-list .list .item .operation {
|
||||
padding: 20upx 30upx;
|
||||
margin-top: 3upx;
|
||||
margin-top: 3upx;
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
}
|
||||
|
||||
.pos-order-list .list .item .operation .more {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<view class="header"></view>
|
||||
<view class="whiteBg">
|
||||
<view class="input">
|
||||
<input type="number" placeholder="0" v-model="verify_code" />
|
||||
<input type="number" placeholder="请输入核销码" v-model="verify_code" />
|
||||
</view>
|
||||
<view class="bnt" @click="codeChange">{{$t(`立即核销`)}}</view>
|
||||
</view>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<view v-if="userInfo.is_money_level">{{$t(`已累积为您节省`)}} {{$t(`¥`)}}<text class="num">{{userInfo.economize_money}}</text>
|
||||
</view>
|
||||
<view v-else>{{$t(`开通即享会员权益`)}}</view>
|
||||
<view class="btn" @click="scrollToCard">{{userInfo.is_money_level ? $t(`续费会员`) : $t(`开通会员`)}}</view>
|
||||
<view class="btn" @click="scrollToCard" v-if="!userInfo.is_ever_level">{{userInfo.is_money_level ? $t(`续费会员`) : $t(`开通会员`)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-section">
|
||||
@ -32,7 +32,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="type-section" id="card">
|
||||
<view class="type-section" id="card" v-if="!userInfo.is_ever_level">
|
||||
<view class="title">
|
||||
<view class="bold">{{userInfo.is_money_level ? $t(`续费会员`) : $t(`开通会员`)}}</view>
|
||||
<view>{{$t(`有效期至`)}}<text class="time">{{memberEndTime}}</text></view>
|
||||
|
||||
@ -1,206 +1,226 @@
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class='evaluate-list'>
|
||||
<view class='generalComment acea-row row-between-wrapper'>
|
||||
<view class='acea-row row-middle'>
|
||||
<view class='evaluate'>{{$t(`评分`)}}</view>
|
||||
<view class='start' :class="'star'+replyData.reply_star"></view>
|
||||
</view>
|
||||
<view>{{$t(`好评率`)}}<text class='font-num'>{{replyData.reply_chance}}%</text></view>
|
||||
</view>
|
||||
<view class='nav acea-row row-middle'>
|
||||
<view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>{{$t(`全部`)}}({{replyData.sum_count}})
|
||||
</view>
|
||||
<view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>{{$t(`好评`)}}({{replyData.good_count}})
|
||||
</view>
|
||||
<view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>{{$t(`中评`)}}({{replyData.in_count}})
|
||||
</view>
|
||||
<view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>{{$t(`差评`)}}({{replyData.poor_count}})
|
||||
</view>
|
||||
</view>
|
||||
<userEvaluation :reply="reply"></userEvaluation>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if="reply.length>0">
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
<view class='noCommodity' v-if="reply.length==0">
|
||||
<view class='emptyBox'>
|
||||
<image :src="imgHost + '/statics/images/noMessage.png'"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getReplyList,
|
||||
getReplyConfig
|
||||
} from '@/api/store.js';
|
||||
import userEvaluation from '@/components/userEvaluation';
|
||||
import colors from '@/mixins/color.js';
|
||||
import {HTTP_REQUEST_URL} from '@/config/app';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
export default {
|
||||
components: {
|
||||
userEvaluation
|
||||
},
|
||||
mixins: [colors],
|
||||
computed: mapGetters(['isLogin']),
|
||||
data() {
|
||||
return {
|
||||
imgHost:HTTP_REQUEST_URL,
|
||||
replyData: {},
|
||||
product_id: 0,
|
||||
reply: [],
|
||||
type: 0,
|
||||
loading: false,
|
||||
loadend: false,
|
||||
loadTitle: this.$t(`加载更多`),
|
||||
page: 1,
|
||||
limit: 20
|
||||
};
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
let that = this;
|
||||
if (!options.product_id) return that.$util.Tips({
|
||||
title: that.$t(`缺少参数`)
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
that.product_id = options.product_id;
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.getProductReplyCount();
|
||||
this.getProductReplyList();
|
||||
} else {
|
||||
toLogin()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取评论统计数据
|
||||
*
|
||||
*/
|
||||
getProductReplyCount: function() {
|
||||
let that = this;
|
||||
getReplyConfig(that.product_id).then(res => {
|
||||
that.$set(that, 'replyData', res.data);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 分页获取评论
|
||||
*/
|
||||
getProductReplyList: function() {
|
||||
let that = this;
|
||||
if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
that.loading = true;
|
||||
that.loadTitle = '';
|
||||
getReplyList(that.product_id, {
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
type: that.type,
|
||||
}).then(res => {
|
||||
let list = res.data,
|
||||
loadend = list.length < that.limit;
|
||||
that.reply = that.$util.SplitArray(list, that.reply);
|
||||
that.$set(that, 'reply', that.reply);
|
||||
that.loading = false;
|
||||
that.loadend = loadend;
|
||||
that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
|
||||
that.page = that.page + 1;
|
||||
}).catch(err => {
|
||||
that.loading = false,
|
||||
that.loadTitle = that.$t(`加载更多`)
|
||||
});
|
||||
},
|
||||
/*
|
||||
* 点击事件切换
|
||||
* */
|
||||
changeType: function(e) {
|
||||
let type = parseInt(e);
|
||||
if (type == this.type) return;
|
||||
this.type = type;
|
||||
this.page = 1;
|
||||
this.loadend = false;
|
||||
this.$set(this, 'reply', []);
|
||||
this.getProductReplyList();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
this.getProductReplyList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.evaluate-list .generalComment {
|
||||
height: 94rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-top: 1rpx;
|
||||
background-color: #fff;
|
||||
font-size: 28rpx;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.evaluate-list .generalComment .evaluate {
|
||||
margin-right: 7rpx;
|
||||
}
|
||||
|
||||
.evaluate-list .nav {
|
||||
font-size: 24rpx;
|
||||
color: #282828;
|
||||
padding: 0 30rpx 32rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.evaluate-list .nav .item {
|
||||
font-size: 24rpx;
|
||||
color: #282828;
|
||||
border-radius: 6rpx;
|
||||
height: 54rpx;
|
||||
padding: 0 20rpx;
|
||||
background-color: #f4f4f4;
|
||||
line-height: 54rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
|
||||
.evaluate-list .nav .item.bg-color {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.noCommodity {
|
||||
background-color: #fff;
|
||||
padding-bottom: 30rpx;
|
||||
.emptyBox{
|
||||
text-align: center;
|
||||
padding-top: 20rpx;
|
||||
.tips{
|
||||
color: #aaa;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
image {
|
||||
width: 414rpx;
|
||||
height: 304rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class='evaluate-list'>
|
||||
<view class='generalComment acea-row row-between-wrapper'>
|
||||
<view class='acea-row row-middle'>
|
||||
<view class='evaluate'>{{$t(`评分`)}}</view>
|
||||
<view class='start' :class="'star'+replyData.reply_star"></view>
|
||||
</view>
|
||||
<view>{{$t(`好评率`)}}<text class='font-num'>{{replyData.reply_chance}}%</text></view>
|
||||
</view>
|
||||
<view class='nav acea-row row-middle'>
|
||||
<view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>
|
||||
{{$t(`全部`)}}({{replyData.sum_count}})
|
||||
</view>
|
||||
<view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>
|
||||
{{$t(`好评`)}}({{replyData.good_count}})
|
||||
</view>
|
||||
<view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>
|
||||
{{$t(`中评`)}}({{replyData.in_count}})
|
||||
</view>
|
||||
<view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>
|
||||
{{$t(`差评`)}}({{replyData.poor_count}})
|
||||
</view>
|
||||
</view>
|
||||
<userEvaluation :reply="reply"></userEvaluation>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if="reply.length>0">
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
<view class='noCommodity' v-if="reply.length==0">
|
||||
<view class='emptyBox'>
|
||||
<image :src="imgHost + '/statics/images/noMessage.png'"></image>
|
||||
</view>
|
||||
<view class="text">
|
||||
{{$t(`暂无评论`)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getReplyList,
|
||||
getReplyConfig
|
||||
} from '@/api/store.js';
|
||||
import userEvaluation from '@/components/userEvaluation';
|
||||
import colors from '@/mixins/color.js';
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
export default {
|
||||
components: {
|
||||
userEvaluation
|
||||
},
|
||||
mixins: [colors],
|
||||
computed: mapGetters(['isLogin']),
|
||||
data() {
|
||||
return {
|
||||
imgHost: HTTP_REQUEST_URL,
|
||||
replyData: {},
|
||||
product_id: 0,
|
||||
reply: [],
|
||||
type: 0,
|
||||
loading: false,
|
||||
loadend: false,
|
||||
loadTitle: this.$t(`加载更多`),
|
||||
page: 1,
|
||||
limit: 20
|
||||
};
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let that = this;
|
||||
if (!options.product_id) return that.$util.Tips({
|
||||
title: that.$t(`缺少参数`)
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
that.product_id = options.product_id;
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.getProductReplyCount();
|
||||
this.getProductReplyList();
|
||||
} else {
|
||||
toLogin()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取评论统计数据
|
||||
*
|
||||
*/
|
||||
getProductReplyCount: function() {
|
||||
let that = this;
|
||||
getReplyConfig(that.product_id).then(res => {
|
||||
that.$set(that, 'replyData', res.data);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 分页获取评论
|
||||
*/
|
||||
getProductReplyList: function() {
|
||||
let that = this;
|
||||
if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
that.loading = true;
|
||||
that.loadTitle = '';
|
||||
getReplyList(that.product_id, {
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
type: that.type,
|
||||
}).then(res => {
|
||||
let list = res.data,
|
||||
loadend = list.length < that.limit;
|
||||
that.reply = that.$util.SplitArray(list, that.reply);
|
||||
that.$set(that, 'reply', that.reply);
|
||||
that.loading = false;
|
||||
that.loadend = loadend;
|
||||
that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
|
||||
that.page = that.page + 1;
|
||||
}).catch(err => {
|
||||
that.loading = false,
|
||||
that.loadTitle = that.$t(`加载更多`)
|
||||
});
|
||||
},
|
||||
/*
|
||||
* 点击事件切换
|
||||
* */
|
||||
changeType: function(e) {
|
||||
let type = parseInt(e);
|
||||
if (type == this.type) return;
|
||||
this.type = type;
|
||||
this.page = 1;
|
||||
this.loadend = false;
|
||||
this.$set(this, 'reply', []);
|
||||
this.getProductReplyList();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
this.getProductReplyList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.evaluate-list .generalComment {
|
||||
height: 94rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-top: 1rpx;
|
||||
background-color: #fff;
|
||||
font-size: 28rpx;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.evaluate-list .generalComment .evaluate {
|
||||
margin-right: 7rpx;
|
||||
}
|
||||
|
||||
.evaluate-list .nav {
|
||||
font-size: 24rpx;
|
||||
color: #282828;
|
||||
padding: 0 30rpx 32rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.evaluate-list .nav .item {
|
||||
font-size: 24rpx;
|
||||
color: #282828;
|
||||
border-radius: 6rpx;
|
||||
height: 54rpx;
|
||||
padding: 0 20rpx;
|
||||
background-color: #f4f4f4;
|
||||
line-height: 54rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
|
||||
.evaluate-list .nav .item.bg-color {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.noCommodity {
|
||||
background-color: #fff;
|
||||
padding-bottom: 30rpx;
|
||||
padding-top: 100rpx;
|
||||
|
||||
.text {
|
||||
padding-top: 40rpx;
|
||||
text-align: center;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.emptyBox {
|
||||
text-align: center;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.tips {
|
||||
color: #aaa;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 414rpx;
|
||||
height: 304rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -175,7 +175,8 @@
|
||||
{{$t(`¥`)}}{{(parseFloat(priceGroup.totalPrice)+parseFloat(priceGroup.vipPrice)).toFixed(2)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper' v-if="priceGroup.storePostage > 0">
|
||||
<view class='item acea-row row-between-wrapper'
|
||||
v-if="priceGroup.storePostage > 0 || priceGroup.storePostageDiscount > 0">
|
||||
<view>{{$t(`配送运费`)}}:</view>
|
||||
<view class='money'>
|
||||
{{$t(`¥`)}}{{(parseFloat(priceGroup.storePostage)+parseFloat(priceGroup.storePostageDiscount)).toFixed(2)}}
|
||||
@ -231,7 +232,6 @@
|
||||
@changePayType="changePayType" @onChangeFun="onChangeFun"></payment>
|
||||
<canvas canvas-id="canvas" v-if="canvasStatus"
|
||||
:style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -337,7 +337,15 @@
|
||||
value: 'friend',
|
||||
title: this.$t(`找微信好友支付`),
|
||||
payStatus: 1,
|
||||
},
|
||||
{
|
||||
"name": this.$t(`通联支付`),
|
||||
"icon": "icon-tonglianzhifu1",
|
||||
value: 'allinpay',
|
||||
title: this.$t(`使用通联支付付款`),
|
||||
payStatus: 1,
|
||||
}
|
||||
|
||||
],
|
||||
virtual_type: 0,
|
||||
formContent: '',
|
||||
@ -412,8 +420,9 @@
|
||||
discount_id: 0,
|
||||
is_shipping: true,
|
||||
inputTrip: false,
|
||||
focus: true,
|
||||
focus: true,
|
||||
integral_open: false,
|
||||
jumpData: {}
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
@ -479,6 +488,44 @@
|
||||
*/
|
||||
onShow: function() {
|
||||
let _this = this
|
||||
let options = wx.getEnterOptionsSync();
|
||||
if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) {
|
||||
// 代表从收银台小程序返回
|
||||
let extraData = options.referrerInfo.extraData;
|
||||
this.initIn = false
|
||||
if (!extraData) {
|
||||
// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
|
||||
this.$util.Tips({
|
||||
title: this.$t(`取消支付`)
|
||||
}, {
|
||||
tab: 5,
|
||||
url: `/pages/goods/order_pay_status/index?order_id=${this.jumpData.orderId}&msg=${this.$t(`取消支付`)}&type=3&totalPrice=${this.totalPrice}&status=2`
|
||||
});
|
||||
} else {
|
||||
if (extraData.code == 'success') {
|
||||
this.$util.Tips({
|
||||
title: this.$t(`支付成功`),
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: `/pages/goods/order_pay_status/index?order_id=${this.jumpData.orderId}&msg=${this.jumpData.msg}&type=3&totalPrice=${this.totalPrice}`
|
||||
});
|
||||
} else if (extraData.code == 'cancel') {
|
||||
// "支付已取消";
|
||||
this.$util.Tips({
|
||||
title: this.$t(`取消支付`)
|
||||
}, {
|
||||
tab: 5,
|
||||
url: `/pages/goods/order_pay_status/index?order_id=${this.jumpData.orderId}&msg=${this.$t(`取消支付`)}&type=3&totalPrice=${this.totalPrice}&status=2`
|
||||
});
|
||||
} else {
|
||||
// "支付失败:" + extraData.errmsg;
|
||||
uni.reLaunch({
|
||||
url: `/pages/goods/order_pay_status/index?order_id=${this.jumpData.orderId}&msg=${this.$t(`支付失败`)}&totalPrice=${this.totalPrice}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
uni.$on("handClick", res => {
|
||||
if (res) {
|
||||
_this.system_store = res.address
|
||||
@ -486,6 +533,7 @@
|
||||
// 清除监听
|
||||
uni.$off('handClick');
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkShipping() {
|
||||
@ -812,8 +860,8 @@
|
||||
that.$set(that, 'invoice_func', res.data.invoice_func);
|
||||
that.$set(that, 'special_invoice', res.data.special_invoice);
|
||||
that.$set(that, 'store_self_mention', res.data.store_self_mention);
|
||||
that.$set(that, 'virtual_type', res.data.virtual_type || 0);
|
||||
that.$set(that, 'integral_open', res.data.integral_open);
|
||||
that.$set(that, 'virtual_type', res.data.virtual_type || 0);
|
||||
that.$set(that, 'integral_open', res.data.integral_open);
|
||||
uni.hideLoading()
|
||||
//微信支付是否开启
|
||||
that.cartArr[0].payStatus = res.data.pay_weixin_open || 0
|
||||
@ -821,6 +869,7 @@
|
||||
that.cartArr[1].payStatus = res.data.ali_pay_status || 0;
|
||||
//#ifdef MP
|
||||
that.cartArr[1].payStatus = 0;
|
||||
that.cartArr[5].payStatus = res.data.pay_allin_open || 0;
|
||||
//#endif
|
||||
//余额支付是否开启
|
||||
// that.cartArr[2].title = '可用余额:' + res.data.userInfo.now_money;
|
||||
@ -876,12 +925,12 @@
|
||||
* 获取当前金额可用优惠券
|
||||
*
|
||||
*/
|
||||
getCouponList: function() {
|
||||
getCouponList: function() {
|
||||
let shippingType = this.shippingType;
|
||||
let that = this;
|
||||
let data = {
|
||||
cartId: this.cartId,
|
||||
'new': this.news,
|
||||
'new': this.news,
|
||||
'shippingType': parseInt(shippingType) + 1
|
||||
}
|
||||
getCouponsOrderPrice(this.totalPrice, data).then(res => {
|
||||
@ -938,13 +987,39 @@
|
||||
},
|
||||
onAddress: function() {
|
||||
let that = this;
|
||||
that.textareaStatus = false;
|
||||
that.address.address = true;
|
||||
that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this.cartId +
|
||||
'&pinkId=' +
|
||||
this.pinkId +
|
||||
'&couponId=' +
|
||||
this.couponId;
|
||||
if (this.addressInfo.real_name) {
|
||||
that.textareaStatus = false;
|
||||
that.address.address = true;
|
||||
that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this
|
||||
.cartId +
|
||||
'&pinkId=' +
|
||||
this.pinkId +
|
||||
'&couponId=' +
|
||||
this.couponId;
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/user_address/index?cartId=' + this.cartId + '&pinkId=' + this
|
||||
.pinkId +
|
||||
'&couponId=' + this.couponId + '&new=' + this.news
|
||||
})
|
||||
}
|
||||
},
|
||||
formpost(url, postData) {
|
||||
let tempform = document.createElement("form");
|
||||
tempform.action = url;
|
||||
tempform.method = "post";
|
||||
tempform.target = "_self";
|
||||
tempform.style.display = "none";
|
||||
for (let x in postData) {
|
||||
let opt = document.createElement("input");
|
||||
opt.name = x;
|
||||
opt.value = postData[x];
|
||||
tempform.appendChild(opt);
|
||||
}
|
||||
document.body.appendChild(tempform);
|
||||
this.$nextTick(e => {
|
||||
tempform.submit();
|
||||
})
|
||||
},
|
||||
payment(data) {
|
||||
let that = this;
|
||||
@ -960,6 +1035,52 @@
|
||||
switch (status) {
|
||||
case 'ORDER_EXIST':
|
||||
case 'EXTEND_ORDER':
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: res.msg
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages
|
||||
});
|
||||
case 'ALLINPAY_PAY':
|
||||
uni.hideLoading();
|
||||
// #ifdef MP
|
||||
this.initIn = true
|
||||
wx.openEmbeddedMiniProgram({
|
||||
appId: 'wxef277996acc166c3',
|
||||
extraData: {
|
||||
cusid: jsConfig.cusid,
|
||||
appid: jsConfig.appid,
|
||||
version: jsConfig.version,
|
||||
trxamt: jsConfig.trxamt,
|
||||
reqsn: jsConfig.reqsn,
|
||||
notify_url: jsConfig.notify_url,
|
||||
body: jsConfig.body,
|
||||
remark: jsConfig.remark,
|
||||
validtime: jsConfig.validtime,
|
||||
randomstr: jsConfig.randomstr,
|
||||
paytype: jsConfig.paytype,
|
||||
sign: jsConfig.sign,
|
||||
signtype: jsConfig.signtype
|
||||
}
|
||||
})
|
||||
this.jumpData = {
|
||||
orderId: res.data.result.orderId,
|
||||
msg: res.msg,
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.openURL(jsConfig.payinfo);
|
||||
setTimeout(e => {
|
||||
uni.reLaunch({
|
||||
url: goPages
|
||||
})
|
||||
}, 1000)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.formpost(res.data.result.pay_url, jsConfig)
|
||||
// #endif
|
||||
break;
|
||||
case 'PAY_ERROR':
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
@ -1117,6 +1238,7 @@
|
||||
url: goPages + '&status=1'
|
||||
});
|
||||
break;
|
||||
|
||||
case "WECHAT_H5_PAY":
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
|
||||
@ -198,7 +198,7 @@
|
||||
<view class='conter' v-if="orderInfo.paid">{{$t(`已支付`)}}</view>
|
||||
<view class='conter' v-else>{{$t(`未支付`)}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between'>
|
||||
<view class='item acea-row row-between' v-if="orderInfo.paid">
|
||||
<view>{{$t(`支付方式`)}}:</view>
|
||||
<view class='conter'>{{$t(orderInfo._status._payType)}}</view>
|
||||
</view>
|
||||
@ -290,7 +290,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='wrapper'>
|
||||
<view class='wrapper' v-if="orderInfo.total_price">
|
||||
<view class='item acea-row row-between'>
|
||||
<view>{{$t(`商品总价`)}}:</view>
|
||||
<view class='conter'>
|
||||
@ -321,9 +321,9 @@
|
||||
class='money font-color'>{{$t(`¥`)}}{{parseFloat(orderInfo.pay_price).toFixed(2)}}</text></view>
|
||||
<view class='actualPay acea-row row-right' v-else>
|
||||
<view class="pay-people">
|
||||
<image :src="orderInfo.help_info.pay_avatar" mode=""></image>
|
||||
<image :src="orderInfo.help_info.pay_avatar" mode="代付头像"></image>
|
||||
<view class="pay-nickname">
|
||||
{{orderInfo.help_info.pay_nickname}}
|
||||
{{orderInfo.help_info.pay_nickname || ''}}
|
||||
</view>
|
||||
</view>
|
||||
{{$t(`总代付`)}}:<text
|
||||
@ -358,17 +358,17 @@
|
||||
hover-class='none' :url="'/pages/goods/goods_logistics/index?orderId='+ orderInfo.order_id">
|
||||
{{$t(`查看物流`)}}
|
||||
</navigator>
|
||||
<view class='bnt bg-color' v-if="orderInfo.type==3" @tap='goJoinPink'>{{$t(`查看拼团`)}}</view>
|
||||
<view class='bnt bg-color' v-if="orderInfo.type == 3 && orderInfo.refund_type == 0" @tap='goJoinPink'>
|
||||
{{$t(`查看拼团`)}}
|
||||
</view>
|
||||
<view class='bnt bg-color' v-if="status.class_status==3 && !split.length" @click='confirmOrder()'>
|
||||
{{$t(`确认收货`)}}
|
||||
</view>
|
||||
<view class='bnt cancel' v-if="status.type==4 && !split.length ||status.type==-2" @tap='delOrder'>
|
||||
{{$t(`删除订单`)}}
|
||||
</view>
|
||||
<view class='bnt bg-color' v-if="status.class_status==5" @tap='goOrderConfirm'>{{$t(`再次购买`)}}
|
||||
</view>
|
||||
<view class='bnt bg-color refundBnt'
|
||||
v-if="[1,2,4].includes(orderInfo.refund_type) && !orderInfo.is_cancel" @tap='cancelRefundOrder'>
|
||||
v-if="[1,2,4].includes(orderInfo.refund_type) && !orderInfo.is_cancel && orderInfo.type !=3"
|
||||
@tap='cancelRefundOrder'>
|
||||
{{$t(`取消申请`)}}
|
||||
</view>
|
||||
<view class='bnt bg-color refundBnt' v-if="orderInfo.refund_type== 4" @tap='refundInput'>
|
||||
@ -378,6 +378,9 @@
|
||||
:url="'/pages/goods/goods_logistics/index?orderId='+ orderInfo.order_id + '&type=refund'">
|
||||
{{$t(`查看退货物流`)}}
|
||||
</navigator>
|
||||
<view class='bnt cancel' v-if="status.type==4 && !split.length || status.type == -2" @tap='delOrder'>
|
||||
{{$t(`删除订单`)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<home v-show="!aleartStatus && !invShow"></home>
|
||||
@ -537,6 +540,13 @@
|
||||
value: 'friend',
|
||||
title: this.$t(`找微信好友支付`),
|
||||
payStatus: 1,
|
||||
},
|
||||
{
|
||||
"name": this.$t(`通联支付`),
|
||||
"icon": "icon-tonglianzhifu1",
|
||||
value: 'allinpay',
|
||||
title: this.$t(`使用通联支付付款`),
|
||||
payStatus: 1,
|
||||
}
|
||||
],
|
||||
pay_close: false,
|
||||
@ -576,6 +586,31 @@
|
||||
this.getOrderInfo();
|
||||
this.getUserInfo();
|
||||
this.getCustomerType();
|
||||
let options = wx.getEnterOptionsSync();
|
||||
console.log(options)
|
||||
if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3') {
|
||||
// 代表从收银台小程序返回
|
||||
let extraData = options.referrerInfo.extraData;
|
||||
if (!extraData) {
|
||||
// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
|
||||
this.getOrderInfo();
|
||||
} else {
|
||||
if (extraData.code == 'success') {
|
||||
// "支付成功";
|
||||
this.getOrderInfo();
|
||||
} else if (extraData.code == 'cancel') {
|
||||
// "支付已取消";
|
||||
this.$util.Tips({
|
||||
title: this.$t(`支付已取消`)
|
||||
});
|
||||
} else {
|
||||
// "支付失败:" + extraData.errmsg;
|
||||
this.$util.Tips({
|
||||
title: this.$t(`支付失败:${extraData.errmsg}`)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
@ -925,10 +960,15 @@
|
||||
}
|
||||
if (item.value == 'friend') {
|
||||
item.payStatus = res.data.friend_pay_status == 1 ? true : false;
|
||||
}
|
||||
if (item.value == 'allinpay') {
|
||||
item.payStatus = res.data.pay_allin_open == 1 ? true : false;
|
||||
}
|
||||
});
|
||||
|
||||
that.getOrderStatus();
|
||||
}).catch(err => {
|
||||
}).catch(err => {
|
||||
console.log(err,'err')
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
|
||||
@ -1,397 +1,404 @@
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class='payment-status' v-if="(!orderLottery || !order_pay_info.paid) && loading && lotteryLoading">
|
||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
||||
<view class='iconfont icons icon-duihao2 bg-color'
|
||||
v-if="order_pay_info.paid || order_pay_info.pay_type == 'offline'"></view>
|
||||
<view class='iconfont icons icon-iconfontguanbi' v-else></view>
|
||||
<!-- 失败时:订单支付失败 -->
|
||||
<view class='status' v-if="order_pay_info.pay_type != 'offline'">{{order_pay_info.paid ? $t(`订单支付成功`):$t(`订单支付失败`)}}
|
||||
</view>
|
||||
<view class='status' v-else>{{$t(`订单创建成功`)}}</view>
|
||||
<view class='wrapper'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`订单号`)}}</view>
|
||||
<view class='itemCom'>{{orderId}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`下单时间`)}}</view>
|
||||
<view class='itemCom'>{{order_pay_info._add_time}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`支付方式`)}}</view>
|
||||
<view class='itemCom'>{{$t(order_pay_info._status._payType) || $t(`暂未支付`)}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`支付金额`)}}</view>
|
||||
<view class='itemCom'>{{order_pay_info.pay_price}}</view>
|
||||
</view>
|
||||
<!--失败时加上这个 -->
|
||||
<view class='item acea-row row-between-wrapper'
|
||||
v-if="order_pay_info.paid==0 && order_pay_info.pay_type != 'offline'">
|
||||
<view>{{$t(`失败原因`)}}</view>
|
||||
<view class='itemCom'>{{status==2 ? $t(`取消支付`):msg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--失败时: 重新购买 -->
|
||||
<view @tap="goOrderDetails" v-if="status==0">
|
||||
<button formType="submit" class='returnBnt bg-color' hover-class='none'>{{$t(`查看订单`)}}</button>
|
||||
</view>
|
||||
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
|
||||
<button class='returnBnt bg-color' hover-class='none'>{{$t(`重新购买`)}}</button>
|
||||
</view>
|
||||
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
|
||||
<button class='returnBnt bg-color' hover-class='none'>{{$t(`重新支付`)}}</button>
|
||||
</view>
|
||||
<button @click="goPink(order_pay_info.pink_id)" class='returnBnt cart-color' formType="submit"
|
||||
hover-class='none'
|
||||
v-if="order_pay_info.pink_id && order_pay_info.paid!=0 && status!=2 && status!=1">{{$t(`邀请好友参团`)}}</button>
|
||||
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none'
|
||||
v-else>{{$t(`返回首页`)}}</button>
|
||||
<view class="coupons" v-if='couponList.length'>
|
||||
<view class="title acea-row row-center-wrapper">
|
||||
<view class="line"></view>
|
||||
<view class="name">{{$t(`赠送优惠券`)}}</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper" v-for="(item,index) in couponList" :key='index'
|
||||
v-if="index<2 || !couponsHidden">
|
||||
<view class="moneyCon acea-row row-between-wrapper">
|
||||
<view class="price acea-row row-center-wrapper">
|
||||
<view>
|
||||
{{$t(`¥`)}}<text>{{item.coupon_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1">{{item.coupon_title}}</view>
|
||||
<view class="priceMin">{{$t(`满`)}}{{item.use_min_price}}{{$t(`元可用`)}}</view>
|
||||
<view class="time">{{$t(`有效期`)}}:{{ item.add_time ? item.add_time + "-" : ""}}{{ item.end_time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="open acea-row row-center-wrapper" @click="openTap" v-if="couponList.length>2">
|
||||
{{couponsHidden?$t(`更多`):$t(`关闭`)}}<text class="iconfont"
|
||||
:class='couponsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<lotteryModel v-show="orderLottery && order_pay_info.paid && loading && lotteryLoading" :options="options"
|
||||
@orderDetails="goOrderDetails" @lotteryShow="getOrderLottery"></lotteryModel>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import lotteryModel from './payLottery.vue'
|
||||
import {
|
||||
getOrderDetail,
|
||||
orderCoupon
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
openOrderSubscribe
|
||||
} from '@/utils/SubscribeMessage.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import colors from "@/mixins/color";
|
||||
export default {
|
||||
components: {
|
||||
lotteryModel,
|
||||
// #ifdef MP
|
||||
authorize
|
||||
// #endif
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
lotteryLoading: false,
|
||||
orderLottery: false,
|
||||
orderId: '',
|
||||
order_pay_info: {
|
||||
paid: 1,
|
||||
_status: {}
|
||||
},
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
status: 0,
|
||||
msg: '',
|
||||
couponsHidden: true,
|
||||
couponList: [],
|
||||
options: {}
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getOrderPayInfo();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.options = options
|
||||
if (!options.order_id) return this.$util.Tips({
|
||||
title: this.$t(`缺少参数无法查看订单支付状态`)
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
this.orderId = options.order_id;
|
||||
this.status = options.status || 0;
|
||||
this.msg = options.msg || '';
|
||||
|
||||
// // #ifdef H5
|
||||
// document.addEventListener('visibilitychange', (e) => {
|
||||
// let state = document.visibilityState
|
||||
// if (state == 'hidden') {
|
||||
// console.log('用户离开了');
|
||||
// }
|
||||
// if (state == 'visible') {
|
||||
// this.getOrderPayInfo();
|
||||
// }
|
||||
// });
|
||||
// // #endif
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.getOrderPayInfo();
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getOrderLottery(status) {
|
||||
this.orderLottery = status
|
||||
this.lotteryLoading = true
|
||||
},
|
||||
openTap() {
|
||||
this.$set(this, 'couponsHidden', !this.couponsHidden);
|
||||
},
|
||||
onLoadFun: function() {
|
||||
this.getOrderPayInfo();
|
||||
},
|
||||
/**
|
||||
*
|
||||
* 支付完成查询支付状态
|
||||
*
|
||||
*/
|
||||
getOrderPayInfo: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: that.$t(`正在加载中`)
|
||||
});
|
||||
getOrderDetail(that.orderId).then(res => {
|
||||
uni.hideLoading();
|
||||
that.$set(that, 'order_pay_info', res.data);
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.paid ? that.$t(`支付成功`) : that.$t(`未支付`)
|
||||
});
|
||||
this.loading = true
|
||||
this.getOrderCoupon()
|
||||
}).catch(err => {
|
||||
this.loading = true
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
getOrderCoupon() {
|
||||
let that = this;
|
||||
orderCoupon(that.orderId).then(res => {
|
||||
that.couponList = res.data;
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 去首页关闭当前所有页面
|
||||
*/
|
||||
goIndex: function(e) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
},
|
||||
// 去参团页面;
|
||||
goPink: function(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/goods_combination_status/index?id=' + id
|
||||
});
|
||||
},
|
||||
/**
|
||||
*
|
||||
* 去订单详情页面
|
||||
*/
|
||||
goOrderDetails: function(e) {
|
||||
let that = this;
|
||||
// #ifdef MP
|
||||
uni.showLoading({
|
||||
title: that.$t(`正在加载中`),
|
||||
})
|
||||
openOrderSubscribe().then(res => {
|
||||
uni.hideLoading();
|
||||
uni.redirectTo({
|
||||
url: '/pages/goods/order_details/index?order_id=' + that.orderId
|
||||
});
|
||||
}).catch(() => {
|
||||
nui.hideLoading();
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
uni.redirectTo({
|
||||
url: '/pages/goods/order_details/index?order_id=' + that.orderId
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.coupons {
|
||||
.title {
|
||||
margin: 30rpx 0 25rpx 0;
|
||||
|
||||
.line {
|
||||
width: 70rpx;
|
||||
height: 1px;
|
||||
background: #DCDCDC;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 20rpx;
|
||||
|
||||
.item {
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
|
||||
|
||||
.price {
|
||||
width: 236rpx;
|
||||
height: 160rpx;
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
font-weight: 800;
|
||||
|
||||
text {
|
||||
font-size: 54rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
width: 385rpx;
|
||||
|
||||
.name {
|
||||
font-size: #282828;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.priceMin {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.open {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 25rpx;
|
||||
margin: 5rpx 0 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.payment-status {
|
||||
background-color: #fff;
|
||||
margin: 195rpx 30rpx 0 30rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 1rpx 0 28rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .icons {
|
||||
font-size: 70rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 140rpx;
|
||||
text-shadow: 0px 4px 0px rgba(255,255,255,0.5);
|
||||
border: 6rpx solid #f5f5f5;
|
||||
margin: -76rpx auto 0 auto;
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.payment-status .icons.icon-iconfontguanbi {
|
||||
text-shadow: 0px 4px 0px #6c6d6d;
|
||||
}
|
||||
|
||||
.payment-status .iconfont.fail {
|
||||
text-shadow: 0px 4px 0px #7a7a7a;
|
||||
}
|
||||
|
||||
.payment-status .status {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin: 25rpx 0 37rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper {
|
||||
border: 1rpx solid #eee;
|
||||
margin: 0 30rpx 47rpx 30rpx;
|
||||
padding: 35rpx 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item {
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item~.item {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item .itemCom {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.payment-status .returnBnt {
|
||||
width: 630rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 0 auto 20rpx auto;
|
||||
}
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class='payment-status' v-if="(!orderLottery || !order_pay_info.paid) && loading && lotteryLoading">
|
||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
||||
<view class='iconfont icons icon-duihao2 bg-color'
|
||||
v-if="order_pay_info.paid || order_pay_info.pay_type == 'offline'"></view>
|
||||
<view class='iconfont icons icon-iconfontguanbi' v-else></view>
|
||||
<!-- 失败时:订单支付失败 -->
|
||||
<view class='status' v-if="order_pay_info.pay_type != 'offline'">
|
||||
{{order_pay_info.paid ? $t(`订单支付成功`):$t(payType ? `订单支付中`:`订单支付失败`)}}
|
||||
</view>
|
||||
<view class='status' v-else>{{$t(`订单创建成功`)}}</view>
|
||||
<view class='wrapper'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`订单号`)}}</view>
|
||||
<view class='itemCom'>{{orderId}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`下单时间`)}}</view>
|
||||
<view class='itemCom'>{{order_pay_info._add_time}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`支付方式`)}}</view>
|
||||
<view class='itemCom'>{{$t(order_pay_info._status._payType) || $t(`暂未支付`)}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>{{$t(`支付金额`)}}</view>
|
||||
<view class='itemCom'>{{order_pay_info.pay_price}}</view>
|
||||
</view>
|
||||
<!--失败时加上这个 -->
|
||||
<view class='item acea-row row-between-wrapper'
|
||||
v-if="order_pay_info.paid==0 && order_pay_info.pay_type != 'offline'">
|
||||
<view>{{$t(`失败原因`)}}</view>
|
||||
<view class='itemCom'>{{status==2 ? $t(`取消支付`):msg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--失败时: 重新购买 -->
|
||||
<view @tap="goOrderDetails" v-if="status==0">
|
||||
<button formType="submit" class='returnBnt bg-color' hover-class='none'>{{$t(`查看订单`)}}</button>
|
||||
</view>
|
||||
<view @tap="getOrderPayInfo" v-if="payType == 'ALLINPAY_PAY'">
|
||||
<button class='returnBnt bg-color' hover-class='none'>{{$t(`刷新支付状态`)}}</button>
|
||||
</view>
|
||||
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
|
||||
<button class='returnBnt bg-color' hover-class='none'>{{$t(`重新购买`)}}</button>
|
||||
</view>
|
||||
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
|
||||
<button class='returnBnt bg-color' hover-class='none'>{{$t(`重新支付`)}}</button>
|
||||
</view>
|
||||
<button @click="goPink(order_pay_info.pink_id)" class='returnBnt cart-color' formType="submit"
|
||||
hover-class='none'
|
||||
v-if="order_pay_info.pink_id && order_pay_info.paid!=0 && status!=2 && status!=1">{{$t(`邀请好友参团`)}}</button>
|
||||
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none'
|
||||
v-else>{{$t(`返回首页`)}}</button>
|
||||
<view class="coupons" v-if='couponList.length'>
|
||||
<view class="title acea-row row-center-wrapper">
|
||||
<view class="line"></view>
|
||||
<view class="name">{{$t(`赠送优惠券`)}}</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper" v-for="(item,index) in couponList" :key='index'
|
||||
v-if="index<2 || !couponsHidden">
|
||||
<view class="moneyCon acea-row row-between-wrapper">
|
||||
<view class="price acea-row row-center-wrapper">
|
||||
<view>
|
||||
{{$t(`¥`)}}<text>{{item.coupon_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1">{{item.coupon_title}}</view>
|
||||
<view class="priceMin">{{$t(`满`)}}{{item.use_min_price}}{{$t(`元可用`)}}</view>
|
||||
<view class="time">
|
||||
{{$t(`有效期`)}}:{{ item.add_time ? item.add_time + "-" : ""}}{{ item.end_time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="open acea-row row-center-wrapper" @click="openTap" v-if="couponList.length>2">
|
||||
{{couponsHidden?$t(`更多`):$t(`关闭`)}}<text class="iconfont"
|
||||
:class='couponsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<lotteryModel v-show="orderLottery && order_pay_info.paid && loading && lotteryLoading" :options="options"
|
||||
@orderDetails="goOrderDetails" @lotteryShow="getOrderLottery"></lotteryModel>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import lotteryModel from './payLottery.vue'
|
||||
import {
|
||||
getOrderDetail,
|
||||
orderCoupon
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
openOrderSubscribe
|
||||
} from '@/utils/SubscribeMessage.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import colors from "@/mixins/color";
|
||||
export default {
|
||||
components: {
|
||||
lotteryModel,
|
||||
// #ifdef MP
|
||||
authorize
|
||||
// #endif
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
lotteryLoading: false,
|
||||
orderLottery: false,
|
||||
orderId: '',
|
||||
order_pay_info: {
|
||||
paid: 1,
|
||||
_status: {}
|
||||
},
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
status: 0,
|
||||
msg: '',
|
||||
couponsHidden: true,
|
||||
couponList: [],
|
||||
options: {},
|
||||
payType: ''
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getOrderPayInfo();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.options = options
|
||||
if (!options.order_id) return this.$util.Tips({
|
||||
title: this.$t(`缺少参数无法查看订单支付状态`)
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
this.orderId = options.order_id;
|
||||
this.status = options.status || 0;
|
||||
this.msg = options.msg || '';
|
||||
this.payType = options.payType || '';
|
||||
|
||||
// // #ifdef H5
|
||||
// document.addEventListener('visibilitychange', (e) => {
|
||||
// let state = document.visibilityState
|
||||
// if (state == 'hidden') {
|
||||
// console.log('用户离开了');
|
||||
// }
|
||||
// if (state == 'visible') {
|
||||
// this.getOrderPayInfo();
|
||||
// }
|
||||
// });
|
||||
// // #endif
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.getOrderPayInfo();
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getOrderLottery(status) {
|
||||
this.orderLottery = status
|
||||
this.lotteryLoading = true
|
||||
},
|
||||
openTap() {
|
||||
this.$set(this, 'couponsHidden', !this.couponsHidden);
|
||||
},
|
||||
onLoadFun: function() {
|
||||
this.getOrderPayInfo();
|
||||
},
|
||||
/**
|
||||
*
|
||||
* 支付完成查询支付状态
|
||||
*
|
||||
*/
|
||||
getOrderPayInfo: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: that.$t(`正在加载中`)
|
||||
});
|
||||
getOrderDetail(that.orderId).then(res => {
|
||||
uni.hideLoading();
|
||||
that.$set(that, 'order_pay_info', res.data);
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.paid ? that.$t(`支付成功`) : that.$t(`未支付`)
|
||||
});
|
||||
this.loading = true
|
||||
this.getOrderCoupon()
|
||||
}).catch(err => {
|
||||
this.loading = true
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
getOrderCoupon() {
|
||||
let that = this;
|
||||
orderCoupon(that.orderId).then(res => {
|
||||
that.couponList = res.data;
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 去首页关闭当前所有页面
|
||||
*/
|
||||
goIndex: function(e) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
},
|
||||
// 去参团页面;
|
||||
goPink: function(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/goods_combination_status/index?id=' + id
|
||||
});
|
||||
},
|
||||
/**
|
||||
*
|
||||
* 去订单详情页面
|
||||
*/
|
||||
goOrderDetails: function(e) {
|
||||
let that = this;
|
||||
// #ifdef MP
|
||||
uni.showLoading({
|
||||
title: that.$t(`正在加载中`),
|
||||
})
|
||||
openOrderSubscribe().then(res => {
|
||||
uni.hideLoading();
|
||||
uni.redirectTo({
|
||||
url: '/pages/goods/order_details/index?order_id=' + that.orderId
|
||||
});
|
||||
}).catch(() => {
|
||||
nui.hideLoading();
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
uni.redirectTo({
|
||||
url: '/pages/goods/order_details/index?order_id=' + that.orderId
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.coupons {
|
||||
.title {
|
||||
margin: 30rpx 0 25rpx 0;
|
||||
|
||||
.line {
|
||||
width: 70rpx;
|
||||
height: 1px;
|
||||
background: #DCDCDC;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 20rpx;
|
||||
|
||||
.item {
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
|
||||
|
||||
.price {
|
||||
width: 236rpx;
|
||||
height: 160rpx;
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
font-weight: 800;
|
||||
|
||||
text {
|
||||
font-size: 54rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
width: 385rpx;
|
||||
|
||||
.name {
|
||||
font-size: #282828;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.priceMin {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.open {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 25rpx;
|
||||
margin: 5rpx 0 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.payment-status {
|
||||
background-color: #fff;
|
||||
margin: 195rpx 30rpx 0 30rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 1rpx 0 28rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .icons {
|
||||
font-size: 70rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 140rpx;
|
||||
text-shadow: 0px 4px 0px rgba(255, 255, 255, 0.5);
|
||||
border: 6rpx solid #f5f5f5;
|
||||
margin: -76rpx auto 0 auto;
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.payment-status .icons.icon-iconfontguanbi {
|
||||
text-shadow: 0px 4px 0px #6c6d6d;
|
||||
}
|
||||
|
||||
.payment-status .iconfont.fail {
|
||||
text-shadow: 0px 4px 0px #7a7a7a;
|
||||
}
|
||||
|
||||
.payment-status .status {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin: 25rpx 0 37rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper {
|
||||
border: 1rpx solid #eee;
|
||||
margin: 0 30rpx 47rpx 30rpx;
|
||||
padding: 35rpx 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item {
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item~.item {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item .itemCom {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.payment-status .returnBnt {
|
||||
width: 630rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 0 auto 20rpx auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -345,9 +345,11 @@
|
||||
@closeChange="closeChange" :showAnimate="showAnimate" @boxStatus="boxStatus">
|
||||
</shareRedPackets>
|
||||
<!-- 组件 -->
|
||||
<productWindow :attr="attr" :isShow="1" :iSplus="1" @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
||||
<productWindow :attr="attr" :isShow="1" :iSplus="1" :limitNum="storeInfo.limit_num"
|
||||
:unitName="storeInfo.unit_name" @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
||||
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id="product-window"
|
||||
:is_vip="is_vip" @getImg="showImg" :is_virtual="storeInfo.is_virtual"></productWindow>
|
||||
:is_vip="is_vip" @getImg="showImg" :is_virtual="storeInfo.is_virtual">
|
||||
</productWindow>
|
||||
<cus-previewImg ref="cusPreviewImg" :list="skuArr" @changeSwitch="changeSwitch"
|
||||
@shareFriend="listenerActionSheet" />
|
||||
<couponListWindow :coupon="coupon" v-if="coupon" @ChangCouponsClone="ChangCouponsClone"
|
||||
@ -663,14 +665,6 @@
|
||||
},
|
||||
onReady: function() {
|
||||
this.isNodes++;
|
||||
// #ifdef H5
|
||||
this.codeVal = window.location.origin + '/pages/goods_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.codeVal = HTTP_REQUEST_URL + '/pages/goods_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
this.$nextTick(function() {
|
||||
// #ifdef MP
|
||||
const menuButton = uni.getMenuButtonBoundingClientRect();
|
||||
@ -706,7 +700,18 @@
|
||||
path: "/pages/goods_details/index?id=" + that.id + "&spid=" + that.uid,
|
||||
};
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
let that = this;
|
||||
userShare();
|
||||
return {
|
||||
title: that.storeInfo.store_name,
|
||||
query: {
|
||||
id: that.id,
|
||||
spid: that.uid || 0,
|
||||
},
|
||||
imageUrl: that.storeInfo.image,
|
||||
};
|
||||
},
|
||||
// #endif
|
||||
onNavigationBarButtonTap(e) {
|
||||
this.currentPage = !this.currentPage
|
||||
@ -914,9 +919,10 @@
|
||||
if (productSelect === undefined && !this.attr.productAttr.length)
|
||||
productSelect = this.attr.productSelect;
|
||||
//无属性值即库存为0;不存在加减;
|
||||
if (productSelect === undefined) return;
|
||||
let stock = productSelect.stock || 0;
|
||||
let num = this.attr.productSelect;
|
||||
if (productSelect === undefined || (this.storeInfo.limit_num && num.cart_num >= this.storeInfo
|
||||
.limit_num && changeValue)) return;
|
||||
if (changeValue) {
|
||||
num.cart_num++;
|
||||
if (num.cart_num > stock) {
|
||||
@ -1065,7 +1071,19 @@
|
||||
that.$set(that, "systemStore", res.data.system_store);
|
||||
that.$set(that, "storeSelfMention", res.data.store_self_mention);
|
||||
that.$set(that, "good_list", goodArray);
|
||||
// that.$set(that, "PromotionCode", storeInfo.code_base);
|
||||
|
||||
if (!storeInfo.wechat_code) {
|
||||
// #ifdef H5
|
||||
this.codeVal = window.location.origin + '/pages/goods_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.codeVal = HTTP_REQUEST_URL + '/pages/goods_details/index?id=' + this.id +
|
||||
'&spid=' + this.$store.state.app.uid
|
||||
// #endif
|
||||
} else {
|
||||
that.$set(that, "PromotionCode", storeInfo.wechat_code);
|
||||
}
|
||||
that.$set(
|
||||
that,
|
||||
"activity",
|
||||
|
||||
@ -679,7 +679,7 @@
|
||||
}
|
||||
this.pageShow = data.is_show
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.title
|
||||
title: this.$t(res.data.title)
|
||||
});
|
||||
let temp = [];
|
||||
let lastArr = that.objToArr(res.data.value);
|
||||
|
||||
@ -217,11 +217,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-product .item .pro-info {
|
||||
.scroll-product .item .pro-info {
|
||||
max-width: 180rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
border-bottom: 0;
|
||||
border-top: 0;
|
||||
padding: 0 10rpx;
|
||||
|
||||
@ -47,6 +47,10 @@
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
canClose: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
authKey: {
|
||||
type: String,
|
||||
default: '',
|
||||
@ -108,7 +112,9 @@
|
||||
});
|
||||
},
|
||||
close(new_user) {
|
||||
this.$emit('close', new_user)
|
||||
if (this.canClose) {
|
||||
this.$emit('close', new_user)
|
||||
}
|
||||
},
|
||||
// 登录
|
||||
loginBtn() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view v-if="isPhoneBox">
|
||||
<view class="mobile-bg" @click="close"></view>
|
||||
<view class="mobile-bg"></view>
|
||||
<view class="mobile-mask animated" :class="{slideInUp:isUp}">
|
||||
<view class="info-box">
|
||||
<image :src="logoUrl"></image>
|
||||
@ -40,8 +40,8 @@
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
keyCode: '',
|
||||
@ -60,6 +60,7 @@
|
||||
});
|
||||
Routine.getCode()
|
||||
.then(code => {
|
||||
|
||||
this.getUserPhoneNumber(e.detail.encryptedData, e.detail.iv, code);
|
||||
})
|
||||
.catch(error => {
|
||||
@ -82,7 +83,11 @@
|
||||
token: res.data.token,
|
||||
time: time
|
||||
});
|
||||
this.getUserInfo();
|
||||
// this.getUserInfo();
|
||||
this.$emit('loginSuccess', {
|
||||
isStatus: true,
|
||||
new_user: res.data.userInfo.new_user
|
||||
})
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
|
||||
@ -1,472 +1,473 @@
|
||||
<template>
|
||||
<view class="main" :style="colorStyle">
|
||||
<view class="head" v-if="!resData.type && !resData.paid">
|
||||
<view class="user-img">
|
||||
<image class="" :src="resData.avatar" mode=""></image>
|
||||
</view>
|
||||
<!-- paid: 0 未支付 1 已支付 type:0 本人 1 好友-->
|
||||
<view class="order-status" v-if="!resData.paid && !resData.type">
|
||||
{{$t(`代付订单创建成功,发给好友帮你付款吧~`)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="head-other" v-else>
|
||||
<view class="user-img">
|
||||
<image class=""
|
||||
:src="resData.paid && !resData.type && resData.pay_uid === $store.state.app.uid ? resData.pay_avatar : resData.avatar"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="order-status">
|
||||
<view class="head-other-nickname">
|
||||
{{resData.paid && !resData.type && resData.pay_uid === $store.state.app.uid ? resData.pay_nickname : resData.nickname}}
|
||||
</view>
|
||||
<view class="head-other-trip" v-if="!resData.paid && resData.type">
|
||||
{{$t(`帮我付一下这件商品了,谢谢~`)}}
|
||||
</view>
|
||||
<view class="head-other-trip"
|
||||
v-if="resData.pay_uid !== $store.state.app.uid && resData.paid && resData.type">
|
||||
{{$t(`已经有人替我代付,谢谢啦~`)}}
|
||||
</view>
|
||||
<view class="head-other-trip"
|
||||
v-if="resData.pay_uid === $store.state.app.uid && resData.paid && resData.type">
|
||||
{{$t(`谢谢你帮我支付,么么哒~`)}}
|
||||
</view>
|
||||
<view class="head-other-trip" v-if="resData.pay_uid !== resData.uid && resData.paid && !resData.type">
|
||||
{{$t(`我已为你代付成功,商家正在努力发货中~`)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-msg">
|
||||
<view class="pay-success" v-if="resData.paid && !resData.type">
|
||||
{{$t(`好友代付成功,商家正在努力发货中~`)}}
|
||||
</view>
|
||||
<view v-else class="pay--box">
|
||||
<view class="order-top">
|
||||
{{$t(`代付金额`)}}
|
||||
</view>
|
||||
<view class="order-num">
|
||||
<text class="icon">{{$t(`¥`)}}</text>
|
||||
{{resData.pay_price}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view v-if="!resData.paid && !resData.type" class="order-btn" @click="appShare('WXSceneSession')">
|
||||
{{$t(`发送给微信好友`)}}
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-if="!resData.paid && !resData.type" class="order-btn" @click="shareFriend">
|
||||
{{$t(`发送给微信好友`)}}
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<button v-if="!resData.paid && !resData.type" class="order-btn" open-type="share" hover-class="none"
|
||||
@click="shareModal = false">
|
||||
{{$t(`发送给微信好友`)}}
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
<button v-if="!resData.paid && !resData.type" class="order-btn detail" @click="goOrderDetail()">
|
||||
{{$t(`查看订单详情`)}}
|
||||
</button>
|
||||
<button class="order-btn" v-if="!resData.paid && resData.type" @tap='payOpen()'>{{$t(`立即付款`)}}</button>
|
||||
<button class="order-btn on-pay" v-if="resData.paid && resData.type">{{$t(`订单已支付`)}}</button>
|
||||
<button class="order-btn" v-if="resData.paid && !resData.type" @tap='goOrderDetail()'>{{$t(`查看订单详情`)}}</button>
|
||||
<view class="order-trip" v-if="resData.pay_uid === $store.state.app.uid && resData.type">
|
||||
{{$t(`如果订单申请退款,已支付金额将原路退还给您`)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-list">
|
||||
<orderGoods :cartInfo="resData.cartInfo" :is_confirm='true' :pay_price="resData.pay_price"
|
||||
:is_behalf="resData.paid && !resData.type ? true :false"></orderGoods>
|
||||
</view>
|
||||
<view class="share-box" v-if="shareModal">
|
||||
<image src="../static/share-info2.png" @click="shareModal = false"></image>
|
||||
</view>
|
||||
<payment :payMode='payMode' :pay_close="pay_close" :friendPay="true" @onChangeFun='onChangeFun'
|
||||
:order_id="order_id" :totalPrice='resData.pay_price'></payment>
|
||||
<!-- #ifndef MP -->
|
||||
<home></home>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderGoods from '@/components/orderGoods';
|
||||
import colors from "@/mixins/color";
|
||||
import payment from '@/components/payment';
|
||||
import home from '@/components/home/index.vue'
|
||||
import {
|
||||
friendDetail
|
||||
} from '@/api/user.js'
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from "@/config/app.js";
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
|
||||
export default {
|
||||
mixins: [colors],
|
||||
components: {
|
||||
orderGoods,
|
||||
payment,
|
||||
home
|
||||
},
|
||||
computed: mapGetters(["isLogin"]),
|
||||
data() {
|
||||
return {
|
||||
shareModal: false,
|
||||
cartInfo: [],
|
||||
resData: {},
|
||||
payMode: [{
|
||||
name: this.$t(`微信支付`),
|
||||
icon: "icon-weixinzhifu",
|
||||
value: 'weixin',
|
||||
title: this.$t(`使用微信快捷支付`),
|
||||
payStatus: true,
|
||||
},
|
||||
// #ifdef H5 || APP-PLUS
|
||||
// {
|
||||
// name: '支付宝支付',
|
||||
// icon: 'icon-zhifubao',
|
||||
// value: 'alipay',
|
||||
// title: '使用线上支付宝支付',
|
||||
// payStatus: true
|
||||
// },
|
||||
// #endif
|
||||
],
|
||||
pay_close: false,
|
||||
order_id: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV == true) {
|
||||
this.getDetail()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
onReady() {
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: '好友代付' || '支付成功'
|
||||
// });
|
||||
},
|
||||
onLoad(option) {
|
||||
this.order_id = option.order_id
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.getDetail()
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
// #ifdef MP
|
||||
onShareAppMessage() {
|
||||
let that = this;
|
||||
return {
|
||||
title: "",
|
||||
imageUrl: "",
|
||||
path: "/pages/users/payment_on_behalf/index?order_id=" + that.order_id + "&spread=" + this.$store.state.app
|
||||
.uid,
|
||||
};
|
||||
},
|
||||
// #endif
|
||||
methods: {
|
||||
/**
|
||||
* 打开支付组件
|
||||
*
|
||||
*/
|
||||
payOpen() {
|
||||
this.pay_close = true;
|
||||
},
|
||||
getDetail() {
|
||||
let that = this;
|
||||
friendDetail(this.order_id).then(res => {
|
||||
this.resData = res.data.info
|
||||
if (this.resData.paid && !this.resData.type) {
|
||||
this.goOrderDetail()
|
||||
}
|
||||
//#ifdef H5
|
||||
this.ShareInfo(this.resData)
|
||||
//#endif
|
||||
}).catch((err) => {
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
}, {
|
||||
tab: 4,
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
});
|
||||
},
|
||||
//#ifdef H5
|
||||
ShareInfo(data) {
|
||||
let href = location.href;
|
||||
if (this.$wechat.isWeixin()) {
|
||||
let configAppMessage = {
|
||||
desc: this.$t(`帮我付一下这件商品了,谢谢~`),
|
||||
title: this.$t(`好友代付`),
|
||||
link: href,
|
||||
imgUrl: data.avatar,
|
||||
};
|
||||
this.$wechat
|
||||
.wechatEvevt(
|
||||
[
|
||||
"updateAppMessageShareData",
|
||||
"updateTimelineShareData",
|
||||
"onMenuShareAppMessage",
|
||||
"onMenuShareTimeline",
|
||||
],
|
||||
configAppMessage
|
||||
)
|
||||
.then((res) => {})
|
||||
.catch((err) => {});
|
||||
}
|
||||
},
|
||||
//#endif
|
||||
// #ifdef APP-PLUS
|
||||
appShare(scene) {
|
||||
let that = this;
|
||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].$page.fullPath; // 获取当前页面路由,也就是最后一个打开的页面路由
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene: scene,
|
||||
type: 0,
|
||||
href: `${HTTP_REQUEST_URL}${curRoute}`,
|
||||
title: that.$t(`好友代付`),
|
||||
summary: that.$t(`帮我付一下这件商品了,谢谢~`),
|
||||
imageUrl: that.resData.paid && !that.resData.type && that.resData.pay_uid === that.$store.state
|
||||
.app.uid ? that.resData.pay_avatar : that.resData.avatar,
|
||||
success: function(res) {
|
||||
uni.showToast({
|
||||
title: that.$t(`分享成功`),
|
||||
icon: "success",
|
||||
duration: 2000,
|
||||
});
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.showToast({
|
||||
title: that.$t(`分享失败`),
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
shareFriend() {
|
||||
// #ifndef MP
|
||||
this.shareModal = true;
|
||||
// #endif
|
||||
},
|
||||
/**
|
||||
* 事件回调
|
||||
*
|
||||
*/
|
||||
onChangeFun(e) {
|
||||
let opt = e;
|
||||
let action = opt.action || null;
|
||||
let value = opt.value != undefined ? opt.value : null;
|
||||
(action && this[action]) && this[action](value);
|
||||
},
|
||||
/**
|
||||
* 关闭支付组件
|
||||
*/
|
||||
payClose() {
|
||||
this.pay_close = false;
|
||||
},
|
||||
/**
|
||||
* 支付失败回调
|
||||
*/
|
||||
pay_fail() {
|
||||
this.pay_close = false;
|
||||
},
|
||||
/**
|
||||
* 支付成功回调
|
||||
*/
|
||||
pay_complete() {
|
||||
this.pay_close = false;
|
||||
this.getDetail();
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/payment_on_behalf/pay_status?order_id=' + this.order_id
|
||||
})
|
||||
},
|
||||
goOrderDetail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods/order_details/index?order_id=' + this.order_id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main {
|
||||
background-color: #f5f5f5;
|
||||
|
||||
.head {
|
||||
background-color: var(--view-theme);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60rpx 0 62rpx 0;
|
||||
|
||||
.user-img {
|
||||
image {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.order-status {
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.head-other {
|
||||
background-color: var(--view-theme);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 60rpx 0 60rpx 30rpx;
|
||||
|
||||
.user-img {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.order-status {
|
||||
margin-left: 20rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
|
||||
.head-other-nickname {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.head-other-trip {
|
||||
padding: 6rpx 13rpx;
|
||||
font-size: 26rpx;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.head-other-trip::after {
|
||||
content: "";
|
||||
width: 0rpx;
|
||||
height: 0rpx;
|
||||
border: 10rpx solid rgba(255, 255, 255, 0.2);
|
||||
border-bottom: 10rpx solid transparent;
|
||||
border-left: 10rpx solid transparent;
|
||||
border-top: 10rpx solid transparent;
|
||||
position: absolute;
|
||||
left: -20rpx;
|
||||
bottom: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-msg {
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx 14rpx 0 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 40rpx 0;
|
||||
margin: -30rpx 30rpx 0 30rpx;
|
||||
|
||||
.pay--box {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pay-success {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.order-num {
|
||||
.icon {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
font-size: 66rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.order-btn {
|
||||
width: 90%;
|
||||
background-color: var(--view-theme);
|
||||
border-radius: 80rpx;
|
||||
padding: 26rpx 0;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.order-btn.detail {
|
||||
margin-top: 20rpx;
|
||||
color: var(--view-theme);
|
||||
background-color: #fff;
|
||||
border: 1px solid var(--view-theme);
|
||||
}
|
||||
|
||||
.order-btn.on-pay {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.order-trip {
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
margin: 30rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.orderGoods {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.share-box {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view class="main" :style="colorStyle">
|
||||
<view class="head" v-if="!resData.type && !resData.paid">
|
||||
<view class="user-img">
|
||||
<image class="" :src="resData.avatar" mode=""></image>
|
||||
</view>
|
||||
<!-- paid: 0 未支付 1 已支付 type:0 本人 1 好友-->
|
||||
<view class="order-status" v-if="!resData.paid && !resData.type">
|
||||
{{$t(`代付订单创建成功,发给好友帮你付款吧~`)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="head-other" v-else>
|
||||
<view class="user-img">
|
||||
<image class=""
|
||||
:src="resData.paid && !resData.type && resData.pay_uid === $store.state.app.uid ? resData.pay_avatar : resData.avatar"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="order-status">
|
||||
<view class="head-other-nickname">
|
||||
{{resData.paid && !resData.type && resData.pay_uid === $store.state.app.uid ? resData.pay_nickname : resData.nickname}}
|
||||
</view>
|
||||
<view class="head-other-trip" v-if="!resData.paid && resData.type">
|
||||
{{$t(`帮我付一下这件商品了,谢谢~`)}}
|
||||
</view>
|
||||
<view class="head-other-trip"
|
||||
v-if="resData.pay_uid !== $store.state.app.uid && resData.paid && resData.type">
|
||||
{{$t(`已经有人替我代付,谢谢啦~`)}}
|
||||
</view>
|
||||
<view class="head-other-trip"
|
||||
v-if="resData.pay_uid === $store.state.app.uid && resData.paid && resData.type">
|
||||
{{$t(`谢谢你帮我支付,么么哒~`)}}
|
||||
</view>
|
||||
<view class="head-other-trip" v-if="resData.pay_uid !== resData.uid && resData.paid && !resData.type">
|
||||
{{$t(`我已为你代付成功,商家正在努力发货中~`)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-msg">
|
||||
<view class="pay-success" v-if="resData.paid && !resData.type">
|
||||
{{$t(`好友代付成功,商家正在努力发货中~`)}}
|
||||
</view>
|
||||
<view v-else class="pay--box">
|
||||
<view class="order-top">
|
||||
{{$t(`代付金额`)}}
|
||||
</view>
|
||||
<view class="order-num">
|
||||
<text class="icon">{{$t(`¥`)}}</text>
|
||||
{{resData.pay_price || 0}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view v-if="!resData.paid && !resData.type" class="order-btn" @click="appShare('WXSceneSession')">
|
||||
{{$t(`发送给微信好友`)}}
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-if="!resData.paid && !resData.type" class="order-btn" @click="shareFriend">
|
||||
{{$t(`发送给微信好友`)}}
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<button v-if="!resData.paid && !resData.type" class="order-btn" open-type="share" hover-class="none"
|
||||
@click="shareModal = false">
|
||||
{{$t(`发送给微信好友`)}}
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
<button v-if="!resData.paid && !resData.type" class="order-btn detail" @click="goOrderDetail()">
|
||||
{{$t(`查看订单详情`)}}
|
||||
</button>
|
||||
<button class="order-btn" v-if="!resData.paid && resData.type" @tap='payOpen()'>{{$t(`立即付款`)}}</button>
|
||||
<button class="order-btn on-pay" v-if="resData.paid && resData.type">{{$t(`订单已支付`)}}</button>
|
||||
<button class="order-btn" v-if="resData.paid && !resData.type"
|
||||
@tap='goOrderDetail()'>{{$t(`查看订单详情`)}}</button>
|
||||
<view class="order-trip" v-if="resData.pay_uid === $store.state.app.uid && resData.type">
|
||||
{{$t(`如果订单申请退款,已支付金额将原路退还给您`)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-list">
|
||||
<orderGoods :cartInfo="resData.cartInfo" :is_confirm='true' :pay_price="resData.pay_price"
|
||||
:is_behalf="resData.paid && !resData.type ? true :false"></orderGoods>
|
||||
</view>
|
||||
<view class="share-box" v-if="shareModal">
|
||||
<image src="../static/share-info2.png" @click="shareModal = false"></image>
|
||||
</view>
|
||||
<payment :payMode='payMode' :pay_close="pay_close" :friendPay="true" @onChangeFun='onChangeFun'
|
||||
:order_id="order_id" :totalPrice='resData.pay_price'></payment>
|
||||
<!-- #ifndef MP -->
|
||||
<home></home>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderGoods from '@/components/orderGoods';
|
||||
import colors from "@/mixins/color";
|
||||
import payment from '@/components/payment';
|
||||
import home from '@/components/home/index.vue'
|
||||
import {
|
||||
friendDetail
|
||||
} from '@/api/user.js'
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from "@/config/app.js";
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
|
||||
export default {
|
||||
mixins: [colors],
|
||||
components: {
|
||||
orderGoods,
|
||||
payment,
|
||||
home
|
||||
},
|
||||
computed: mapGetters(["isLogin"]),
|
||||
data() {
|
||||
return {
|
||||
shareModal: false,
|
||||
cartInfo: [],
|
||||
resData: {},
|
||||
payMode: [{
|
||||
name: this.$t(`微信支付`),
|
||||
icon: "icon-weixinzhifu",
|
||||
value: 'weixin',
|
||||
title: this.$t(`使用微信快捷支付`),
|
||||
payStatus: true,
|
||||
},
|
||||
// #ifdef H5 || APP-PLUS
|
||||
// {
|
||||
// name: '支付宝支付',
|
||||
// icon: 'icon-zhifubao',
|
||||
// value: 'alipay',
|
||||
// title: '使用线上支付宝支付',
|
||||
// payStatus: true
|
||||
// },
|
||||
// #endif
|
||||
],
|
||||
pay_close: false,
|
||||
order_id: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV == true) {
|
||||
this.getDetail()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
onReady() {
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: '好友代付' || '支付成功'
|
||||
// });
|
||||
},
|
||||
onLoad(option) {
|
||||
this.order_id = option.order_id
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.getDetail()
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
// #ifdef MP
|
||||
onShareAppMessage() {
|
||||
let that = this;
|
||||
return {
|
||||
title: "",
|
||||
imageUrl: "",
|
||||
path: "/pages/users/payment_on_behalf/index?order_id=" + that.id + "&spread=" + this.$store.state.app
|
||||
.uid,
|
||||
};
|
||||
},
|
||||
// #endif
|
||||
methods: {
|
||||
/**
|
||||
* 打开支付组件
|
||||
*
|
||||
*/
|
||||
payOpen() {
|
||||
this.pay_close = true;
|
||||
},
|
||||
getDetail() {
|
||||
let that = this;
|
||||
friendDetail(this.order_id).then(res => {
|
||||
this.resData = res.data.info
|
||||
if (this.resData.paid && !this.resData.type) {
|
||||
this.goOrderDetail()
|
||||
}
|
||||
//#ifdef H5
|
||||
this.ShareInfo(this.resData)
|
||||
//#endif
|
||||
}).catch((err) => {
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
}, {
|
||||
tab: 4,
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
});
|
||||
},
|
||||
//#ifdef H5
|
||||
ShareInfo(data) {
|
||||
let href = location.href;
|
||||
if (this.$wechat.isWeixin()) {
|
||||
let configAppMessage = {
|
||||
desc: this.$t(`帮我付一下这件商品了,谢谢~`),
|
||||
title: this.$t(`好友代付`),
|
||||
link: href,
|
||||
imgUrl: data.avatar,
|
||||
};
|
||||
this.$wechat
|
||||
.wechatEvevt(
|
||||
[
|
||||
"updateAppMessageShareData",
|
||||
"updateTimelineShareData",
|
||||
"onMenuShareAppMessage",
|
||||
"onMenuShareTimeline",
|
||||
],
|
||||
configAppMessage
|
||||
)
|
||||
.then((res) => {})
|
||||
.catch((err) => {});
|
||||
}
|
||||
},
|
||||
//#endif
|
||||
// #ifdef APP-PLUS
|
||||
appShare(scene) {
|
||||
let that = this;
|
||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].$page.fullPath; // 获取当前页面路由,也就是最后一个打开的页面路由
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene: scene,
|
||||
type: 0,
|
||||
href: `${HTTP_REQUEST_URL}${curRoute}`,
|
||||
title: that.$t(`好友代付`),
|
||||
summary: that.$t(`帮我付一下这件商品了,谢谢~`),
|
||||
imageUrl: that.resData.paid && !that.resData.type && that.resData.pay_uid === that.$store.state
|
||||
.app.uid ? that.resData.pay_avatar : that.resData.avatar,
|
||||
success: function(res) {
|
||||
uni.showToast({
|
||||
title: that.$t(`分享成功`),
|
||||
icon: "success",
|
||||
duration: 2000,
|
||||
});
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.showToast({
|
||||
title: that.$t(`分享失败`),
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
shareFriend() {
|
||||
// #ifndef MP
|
||||
this.shareModal = true;
|
||||
// #endif
|
||||
},
|
||||
/**
|
||||
* 事件回调
|
||||
*
|
||||
*/
|
||||
onChangeFun(e) {
|
||||
let opt = e;
|
||||
let action = opt.action || null;
|
||||
let value = opt.value != undefined ? opt.value : null;
|
||||
(action && this[action]) && this[action](value);
|
||||
},
|
||||
/**
|
||||
* 关闭支付组件
|
||||
*/
|
||||
payClose() {
|
||||
this.pay_close = false;
|
||||
},
|
||||
/**
|
||||
* 支付失败回调
|
||||
*/
|
||||
pay_fail() {
|
||||
this.pay_close = false;
|
||||
},
|
||||
/**
|
||||
* 支付成功回调
|
||||
*/
|
||||
pay_complete() {
|
||||
this.pay_close = false;
|
||||
this.getDetail();
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/payment_on_behalf/pay_status?order_id=' + this.order_id
|
||||
})
|
||||
},
|
||||
goOrderDetail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods/order_details/index?order_id=' + this.order_id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main {
|
||||
background-color: #f5f5f5;
|
||||
|
||||
.head {
|
||||
background-color: var(--view-theme);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60rpx 0 62rpx 0;
|
||||
|
||||
.user-img {
|
||||
image {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.order-status {
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.head-other {
|
||||
background-color: var(--view-theme);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 60rpx 0 60rpx 30rpx;
|
||||
|
||||
.user-img {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.order-status {
|
||||
margin-left: 20rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
|
||||
.head-other-nickname {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.head-other-trip {
|
||||
padding: 6rpx 13rpx;
|
||||
font-size: 26rpx;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.head-other-trip::after {
|
||||
content: "";
|
||||
width: 0rpx;
|
||||
height: 0rpx;
|
||||
border: 10rpx solid rgba(255, 255, 255, 0.2);
|
||||
border-bottom: 10rpx solid transparent;
|
||||
border-left: 10rpx solid transparent;
|
||||
border-top: 10rpx solid transparent;
|
||||
position: absolute;
|
||||
left: -20rpx;
|
||||
bottom: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-msg {
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx 14rpx 0 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 40rpx 0;
|
||||
margin: -30rpx 30rpx 0 30rpx;
|
||||
|
||||
.pay--box {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pay-success {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.order-num {
|
||||
.icon {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
font-size: 66rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.order-btn {
|
||||
width: 90%;
|
||||
background-color: var(--view-theme);
|
||||
border-radius: 80rpx;
|
||||
padding: 26rpx 0;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.order-btn.detail {
|
||||
margin-top: 20rpx;
|
||||
color: var(--view-theme);
|
||||
background-color: #fff;
|
||||
border: 1px solid var(--view-theme);
|
||||
}
|
||||
|
||||
.order-btn.on-pay {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.order-trip {
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
margin: 30rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.orderGoods {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.share-box {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 413 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 19 KiB |
@ -1,272 +1,277 @@
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class="navbar acea-row row-around">
|
||||
<view class="item acea-row row-center-wrapper" :class="{ on: navOn === 1 }" @click="onNav(1)">{{$t(`未使用`)}}</view>
|
||||
<view class="item acea-row row-center-wrapper" :class="{ on: navOn === 2 }" @click="onNav(2)">{{$t(`已使用/过期`)}}</view>
|
||||
</view>
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index"
|
||||
:class="{svip: item.receive_type === 4}" @click="useCoupon(item)">
|
||||
<view class="moneyCon acea-row row-center-wrapper">
|
||||
<view class='money' :class='item._type == 0 ? "moneyGray" : ""'>
|
||||
<view>{{$t(`¥`)}}<text class='num'>{{item.coupon_price}}</text></view>
|
||||
<view class="pic-num" v-if="item.use_min_price > 0">{{$t(`满`)}}{{item.use_min_price}}{{$t(`元可用`)}}</view>
|
||||
<view class="pic-num" v-else>{{$t(`无门槛券`)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition'>
|
||||
<view class="name line2">
|
||||
<view class="line-title" :class="item._type === 0 ? 'bg-color-huic' : 'bg-color-check'"
|
||||
v-if="item.applicable_type === 0">{{$t(`通用劵`)}}</view>
|
||||
<view class="line-title" :class="item._type === 0 ? 'bg-color-huic' : 'bg-color-check'"
|
||||
v-else-if="item.applicable_type === 1">{{$t(`品类券`)}}</view>
|
||||
<view class="line-title" :class="item._type === 0 ? 'bg-color-huic' : 'bg-color-check'"
|
||||
v-else>{{$t(`商品券`)}}</view>
|
||||
<image src="../../../static/images/fvip.png" class="pic" v-if="item.receive_type===4">
|
||||
</image>
|
||||
<text>{{$t(item.coupon_title)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
<view>{{item.add_time}}-{{item.end_time}}</view>
|
||||
<view class='bnt gray' v-if="item._type==0">{{$t(item._msg)}}</view>
|
||||
<view class='bnt bg-color' v-else>{{$t(item._msg)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='noCommodity' v-if="!couponsList.length && page === 2">
|
||||
<view class='pictrue'>
|
||||
<image :src="imgHost + '/statics/images/noCoupon.png'"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP -->
|
||||
<home></home>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getUserCoupons
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import home from '@/components/home';
|
||||
import colors from '@/mixins/color.js';
|
||||
import {HTTP_REQUEST_URL} from '@/config/app';
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
// #endif
|
||||
home
|
||||
},
|
||||
mixins:[colors],
|
||||
data() {
|
||||
return {
|
||||
imgHost:HTTP_REQUEST_URL,
|
||||
couponsList: [],
|
||||
loading: false,
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
navOn: 1,
|
||||
page: 1,
|
||||
limit: 15,
|
||||
finished: false
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getUseCoupons();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUseCoupons();
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getUseCoupons();
|
||||
},
|
||||
methods: {
|
||||
onNav: function(type) {
|
||||
this.navOn = type;
|
||||
this.couponsList = [];
|
||||
this.page = 1;
|
||||
this.finished = false;
|
||||
this.getUseCoupons();
|
||||
},
|
||||
useCoupon(item){
|
||||
let url = '';
|
||||
if (item.category_id == 0 && item.product_id == '') {
|
||||
url = '/pages/goods/goods_list/index?title=默认'
|
||||
}
|
||||
if (item.category_id != 0) {
|
||||
url = '/pages/goods/goods_list/index?coupon_category_id='+item.category_id
|
||||
}
|
||||
if (item.product_id != '') {
|
||||
let arr = item.product_id.split(',');
|
||||
let num = arr.length;
|
||||
if (num == 1) {
|
||||
url = '/pages/goods_details/index?id='+item.product_id
|
||||
} else {
|
||||
url = '/pages/goods/goods_list/index?productId='+item.product_id+'&title=默认'
|
||||
}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 授权回调
|
||||
*/
|
||||
onLoadFun: function() {
|
||||
this.getUseCoupons();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
/**
|
||||
* 获取领取优惠券列表
|
||||
*/
|
||||
getUseCoupons: function() {
|
||||
let that = this;
|
||||
if (that.loading || that.finished) {
|
||||
return;
|
||||
}
|
||||
that.loading = true;
|
||||
uni.showLoading({
|
||||
title: that.$t(`正在加载…`)
|
||||
});
|
||||
getUserCoupons(this.navOn, {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}).then(res => {
|
||||
that.loading = false;
|
||||
uni.hideLoading();
|
||||
that.couponsList = that.couponsList.concat(res.data);
|
||||
that.finished = res.data.length < that.limit;
|
||||
that.page += 1;
|
||||
}).catch(err => {
|
||||
that.loading = false;
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.money {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pic-num {
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition .name {
|
||||
font-size: 26rpx;
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class="navbar acea-row row-around">
|
||||
<view class="item acea-row row-center-wrapper" :class="{ on: navOn === 1 }" @click="onNav(1)">{{$t(`未使用`)}}
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper" :class="{ on: navOn === 2 }" @click="onNav(2)">
|
||||
{{$t(`已使用/过期`)}}</view>
|
||||
</view>
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index"
|
||||
:class="{svip: item.receive_type === 4}" @click="useCoupon(item)">
|
||||
<view class="moneyCon acea-row row-center-wrapper">
|
||||
<view class='money' :class='item._type == 0 ? "moneyGray" : ""'>
|
||||
<view>{{$t(`¥`)}}<text class='num'>{{item.coupon_price}}</text></view>
|
||||
<view class="pic-num" v-if="item.use_min_price > 0">
|
||||
{{$t(`满`)}}{{item.use_min_price}}{{$t(`元可用`)}}</view>
|
||||
<view class="pic-num" v-else>{{$t(`无门槛券`)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition'>
|
||||
<view class="name line2">
|
||||
<view class="line-title" :class="item._type === 0 ? 'bg-color-huic' : 'bg-color-check'"
|
||||
v-if="item.applicable_type === 0">{{$t(`通用劵`)}}</view>
|
||||
<view class="line-title" :class="item._type === 0 ? 'bg-color-huic' : 'bg-color-check'"
|
||||
v-else-if="item.applicable_type === 1">{{$t(`品类券`)}}</view>
|
||||
<view class="line-title" :class="item._type === 0 ? 'bg-color-huic' : 'bg-color-check'"
|
||||
v-else>{{$t(`商品券`)}}</view>
|
||||
<image src="../../../static/images/fvip.png" class="pic" v-if="item.receive_type===4">
|
||||
</image>
|
||||
{{$t(item.coupon_title)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
<view>{{item.add_time}}-{{item.end_time}}</view>
|
||||
<view class='bnt gray' v-if="item._type==0">{{$t(item._msg)}}</view>
|
||||
<view class='bnt bg-color' v-else>{{$t(item._msg)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='noCommodity' v-if="!couponsList.length && page === 2">
|
||||
<view class='pictrue'>
|
||||
<image :src="imgHost + '/statics/images/noCoupon.png'"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP -->
|
||||
<home></home>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getUserCoupons
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import home from '@/components/home';
|
||||
import colors from '@/mixins/color.js';
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app';
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
// #endif
|
||||
home
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
imgHost: HTTP_REQUEST_URL,
|
||||
couponsList: [],
|
||||
loading: false,
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
navOn: 1,
|
||||
page: 1,
|
||||
limit: 15,
|
||||
finished: false
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getUseCoupons();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUseCoupons();
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getUseCoupons();
|
||||
},
|
||||
methods: {
|
||||
onNav: function(type) {
|
||||
this.navOn = type;
|
||||
this.couponsList = [];
|
||||
this.page = 1;
|
||||
this.finished = false;
|
||||
this.getUseCoupons();
|
||||
},
|
||||
useCoupon(item) {
|
||||
let url = '';
|
||||
if (item.category_id == 0 && item.product_id == '') {
|
||||
url = '/pages/goods/goods_list/index?title=默认'
|
||||
}
|
||||
if (item.category_id != 0) {
|
||||
url = `/pages/goods/goods_list/index?title=${item.coupon_title}&coupon_category_id=${item.category_id}`
|
||||
}
|
||||
if (item.product_id != '') {
|
||||
let arr = item.product_id.split(',');
|
||||
let num = arr.length;
|
||||
if (num == 1) {
|
||||
url = '/pages/goods_details/index?id=' + item.product_id
|
||||
} else {
|
||||
url = '/pages/goods/goods_list/index?productId=' + item.product_id + '&title=默认'
|
||||
}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 授权回调
|
||||
*/
|
||||
onLoadFun: function() {
|
||||
this.getUseCoupons();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
/**
|
||||
* 获取领取优惠券列表
|
||||
*/
|
||||
getUseCoupons: function() {
|
||||
let that = this;
|
||||
if (that.loading || that.finished) {
|
||||
return;
|
||||
}
|
||||
that.loading = true;
|
||||
uni.showLoading({
|
||||
title: that.$t(`正在加载…`)
|
||||
});
|
||||
getUserCoupons(this.navOn, {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}).then(res => {
|
||||
that.loading = false;
|
||||
uni.hideLoading();
|
||||
that.couponsList = that.couponsList.concat(res.data);
|
||||
that.finished = res.data.length < that.limit;
|
||||
that.page += 1;
|
||||
}).catch(err => {
|
||||
that.loading = false;
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.money {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pic-num {
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition .name {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition .pic {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
display: block;
|
||||
margin-right: 10rpx;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.condition .line-title {
|
||||
/* width: 70rpx; */
|
||||
height: 32rpx !important;
|
||||
padding: 0 5px;
|
||||
line-height: 30rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 247, 247, 1);
|
||||
border: 1px solid var(--view-theme);
|
||||
opacity: 1;
|
||||
border-radius: 20rpx;
|
||||
font-size: 18rpx !important;
|
||||
color: var(--view-theme);
|
||||
margin-right: 12rpx;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.condition .line-title.bg-color-huic {
|
||||
border-color: #BBB !important;
|
||||
color: #bbb !important;
|
||||
background-color: #F5F5F5 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #FFFFFF;
|
||||
z-index: 9;
|
||||
|
||||
.item {
|
||||
border-top: 5rpx solid transparent;
|
||||
border-bottom: 5rpx solid transparent;
|
||||
font-size: 30rpx;
|
||||
color: #999999;
|
||||
|
||||
&.on {
|
||||
border-bottom-color: var(--view-theme);
|
||||
color: #282828;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-list {
|
||||
margin-top: 122rpx;
|
||||
}
|
||||
|
||||
.noCommodity {
|
||||
margin-top: 300rpx;
|
||||
}
|
||||
line-height: 28rpx;
|
||||
/* display: flex;
|
||||
align-items: center; */
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition .pic {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
display: block;
|
||||
margin-right: 10rpx;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.condition .line-title {
|
||||
/* width: 70rpx; */
|
||||
height: 36rpx !important;
|
||||
padding: 0 5px;
|
||||
line-height: 32rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 247, 247, 1);
|
||||
border: 1px solid var(--view-theme);
|
||||
opacity: 1;
|
||||
border-radius: 20rpx;
|
||||
font-size: 18rpx !important;
|
||||
color: var(--view-theme);
|
||||
margin-right: 12rpx;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.condition .line-title.bg-color-huic {
|
||||
border-color: #BBB !important;
|
||||
color: #bbb !important;
|
||||
background-color: #F5F5F5 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #FFFFFF;
|
||||
z-index: 9;
|
||||
|
||||
.item {
|
||||
border-top: 5rpx solid transparent;
|
||||
border-bottom: 5rpx solid transparent;
|
||||
font-size: 30rpx;
|
||||
color: #999999;
|
||||
|
||||
&.on {
|
||||
border-bottom-color: var(--view-theme);
|
||||
color: #282828;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-list {
|
||||
margin-top: 122rpx;
|
||||
}
|
||||
|
||||
.noCommodity {
|
||||
margin-top: 300rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -241,8 +241,9 @@
|
||||
.coupon-list .item .text .condition .name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 40rpx;
|
||||
/* display: flex;
|
||||
align-items: center; */
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition .pic {
|
||||
@ -256,12 +257,12 @@
|
||||
|
||||
.condition .line-title {
|
||||
width: 90rpx;
|
||||
height: 32rpx !important;
|
||||
line-height: 30rpx;
|
||||
height: 40rpx !important;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 247, 247, 1);
|
||||
border: 1px solid var(--view-theme);
|
||||
border: 1rpx solid var(--view-theme);
|
||||
opacity: 1;
|
||||
border-radius: 20rpx;
|
||||
font-size: 18rpx !important;
|
||||
|
||||
@ -147,10 +147,8 @@
|
||||
async onReady() {
|
||||
if (this.isLogin) {
|
||||
this.val = `${HTTP_REQUEST_URL}?spid=${this.uid}`
|
||||
await this.getUser()
|
||||
await this.spreadMsgs()
|
||||
getUserInfo().then(res => {
|
||||
this.userInfo = res.data
|
||||
})
|
||||
} else {
|
||||
toLogin();
|
||||
|
||||
@ -181,6 +179,11 @@
|
||||
},
|
||||
// #endif
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserInfo().then(res => {
|
||||
this.userInfo = res.data
|
||||
})
|
||||
},
|
||||
onLoadFun: function(e) {
|
||||
this.$set(this, 'userInfo', e);
|
||||
this.userSpreadBannerList();
|
||||
@ -197,7 +200,6 @@
|
||||
// #ifdef MP
|
||||
this.qrcode = await this.imgToBase(res.data.qrcode)
|
||||
// #endif
|
||||
let codeUrl = "?spread=" + this.userInfo.uid
|
||||
// #ifdef MP
|
||||
await this.routineCode()
|
||||
let mpUrl = await this.downloadFilestoreImage(this.mpUrl)
|
||||
@ -206,11 +208,6 @@
|
||||
title: this.$t(`海报生成中`),
|
||||
mask: true
|
||||
});
|
||||
// #ifdef H5
|
||||
if (this.$wechat.isWeixin() && res.data.qrcode) {
|
||||
this.qrcode = await this.imgToBase(res.data.qrcode)
|
||||
}
|
||||
// #endif
|
||||
for (let i = 0; i < res.data.spread.length; i++) {
|
||||
let that = this
|
||||
let arr2, img
|
||||
@ -218,8 +215,8 @@
|
||||
arr2 = [mpUrl, await this.downloadFilestoreImage(res.data.spread[i].pic)]
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
img = await this.imgToBase(res.data.spread[i].pic)
|
||||
arr2 = [this.qrcode || this.codeSrc, img]
|
||||
img = await this.imgToBase(res.data.spread[i].pic, res.data.qrcode)
|
||||
arr2 = [img.code || this.codeSrc, img.image]
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
img = await this.downloadFilestoreImage(res.data.spread[i].pic)
|
||||
@ -249,11 +246,12 @@
|
||||
let res = await routineCode()
|
||||
this.mpUrl = res.data.url
|
||||
},
|
||||
async imgToBase(url) {
|
||||
async imgToBase(url, code) {
|
||||
let res = await imgToBase({
|
||||
image: url
|
||||
image: url,
|
||||
code: code
|
||||
})
|
||||
return res.data.image
|
||||
return res.data
|
||||
},
|
||||
// 二维码生成
|
||||
codeImg() {
|
||||
|
||||
@ -28,21 +28,20 @@
|
||||
<button v-else hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo"
|
||||
class="bg-green btn1">{{$t(`微信登录`)}}</button>
|
||||
<!-- #endif -->
|
||||
<button hover-class="none" @click="isUp = true" class="btn2">{{$t(`手机号登录`)}}</button>
|
||||
<!-- <button hover-class="none" @click="phoneLogin" class="btn2">{{$t(`手机号登录`)}}</button> -->
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="isUp">
|
||||
<mobileLogin :isUp="isUp" @close="maskClose" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
|
||||
<mobileLogin :isUp="isUp" :canClose="canClose" @close="maskClose" :authKey="authKey"
|
||||
@wechatPhone="wechatPhone"></mobileLogin>
|
||||
</block>
|
||||
<block v-if="isPhoneBox">
|
||||
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey">
|
||||
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @loginSuccess="bindPhoneClose" :authKey="authKey">
|
||||
</routinePhone>
|
||||
</block>
|
||||
<block>
|
||||
<!-- <uni-popup ref="popup" type="bottom" background-color="#fff"> -->
|
||||
<editUserModal :isShow="isShow" @closeEdit="closeEdit" @editSuccess="editSuccess">
|
||||
</editUserModal>
|
||||
<!-- </uni-popup> -->
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
@ -78,6 +77,7 @@
|
||||
data() {
|
||||
return {
|
||||
isUp: false,
|
||||
canClose: true,
|
||||
phone: '',
|
||||
statusBarHeight: statusBarHeight,
|
||||
isHome: false,
|
||||
@ -138,6 +138,7 @@
|
||||
if (res.key !== undefined && res.key) {
|
||||
that.authKey = res.key;
|
||||
that.isUp = true;
|
||||
that.canClose = false;
|
||||
} else {
|
||||
let time = res.expires_time - that.$Cache.time();
|
||||
that.$store.commit('LOGIN', {
|
||||
@ -271,9 +272,18 @@
|
||||
editSuccess() {
|
||||
this.isShow = false
|
||||
},
|
||||
phoneLogin() {
|
||||
this.canClose = true
|
||||
this.isUp = true;
|
||||
},
|
||||
closeEdit() {
|
||||
this.isShow = false
|
||||
uni.navigateBack();
|
||||
this.$util.Tips({
|
||||
title: this.$t(`登录成功`),
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3
|
||||
});
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack();
|
||||
@ -286,26 +296,26 @@
|
||||
// 弹窗关闭
|
||||
maskClose(new_user) {
|
||||
this.isUp = false;
|
||||
// #ifdef MP
|
||||
if (new_user) {
|
||||
this.isShow = true
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
bindPhoneClose(data) {
|
||||
this.isPhoneBox = false;
|
||||
if (data.isStatus) {
|
||||
this.isPhoneBox = false;
|
||||
if (data.new_user) {
|
||||
this.isShow = true
|
||||
} else {
|
||||
this.$util.Tips({
|
||||
title: this.$t(`登录成功`),
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
this.isPhoneBox = false;
|
||||
// #ifdef MP
|
||||
this.getUserInfo(data.new_user)
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
this.$util.Tips({
|
||||
title: this.$t(`登录成功`),
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3
|
||||
});
|
||||
// #endiff
|
||||
}
|
||||
},
|
||||
// #ifdef MP
|
||||
@ -342,12 +352,13 @@
|
||||
this.$store.commit('SETUID', res.data.userInfo.uid);
|
||||
this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
|
||||
this.$Cache.clear('snsapiKey');
|
||||
this.$util.Tips({
|
||||
title: this.$t(`登录成功`),
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3
|
||||
});
|
||||
this.getUserInfo(res.data.userInfo.new_user || 0)
|
||||
// this.$util.Tips({
|
||||
// title: this.$t(`登录成功`),
|
||||
// icon: 'success'
|
||||
// }, {
|
||||
// tab: 3
|
||||
// });
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
@ -364,10 +375,6 @@
|
||||
that.$store.commit('SETUID', res.data.uid);
|
||||
that.$store.commit('UPDATE_USERINFO', res.data);
|
||||
if (new_user) {
|
||||
that.$util.Tips({
|
||||
title: that.$t(`登录成功`),
|
||||
icon: 'success'
|
||||
});
|
||||
this.isShow = true
|
||||
} else {
|
||||
that.$util.Tips({
|
||||
|
||||
@ -444,3 +444,7 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
|
||||
/* 兼容 IOS>11.2 */
|
||||
height: calc(100rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.pd10{
|
||||
padding: 10rpx;
|
||||
}
|
||||
@ -328,9 +328,9 @@
|
||||
.coupon-list .item .money,.coupons .list .item .price{background-repeat:no-repeat;background-size:100% 100%;background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAABVCAMAAAC1iNAIAAAAolBMVEUAAAD////////////////////////////////////////////////////////////////w8PD////x8fH////////////////////09PT4+Pj4+Pj5+fn29vb29vb39/f09PT09PT29vb09PT19fX19fX39/f19fX29vb29vb19fX19fX09PT19fX19fX29vb19fX29vb19fX09PT09PT19fUjCUKaAAAANHRSTlMAAQIDBAUGBwgJCgsMDQ4PEBEREhITFBojRERHUlNXZHJzc3d7fX1+iJSdycvN8fL5+/3+S5lxYgAABUVJREFUaN69Wmlj3CYQBXTflDLUSY/E6eFeSWo3/P+/1g8SC0jDsa4UPnrZHc313puRidZa/0OuOrSkoY+01vrvq8y2AkQTMfzTNXarBZRSsgwa/uMSs8UISiml1IB//vzXJf7SXqrtzOQrnoaDsRvy+JLkztasghq/9OnNZcndDBf4tS9PJye3k55dBSzg8dtT7dbcN6sUVF8hueW8NxsursdvTjPLBqmQI3GXX96fiI8KPaK60nC9BMwqpWAeh/qaUJdT2KwxXlyKj64pwb3O4sXZAIImF5aaEupCp5rOBZAKSy6IdlUAzGkwWZwIIDt8NCaGG1wxnkTt85I7udxf354MmrOquuF4cv1bMx7q1/dxNaPJ7fbyrt2uwXgKgDA0uTAcuajZLgp2AoDQDm2hGRN2/fZpfwn5KaWAo0qWCqy0XgUgKPkp6SaXdtyU9i3F3f9UIDj5wVjsy12sfxkDavNOAKEBfKyQiEy+YWjOJj9/TGGDuSIIIYR0NhktfWVVFyj5yZ7i5S4pIYSU4DzhNLTs7j4O4WMRKHcDGDu1K9s7DTcZyfUiYgCD7poA2ntCHSc/rNxt+9COS3C+Ltl55IeUO7goRpmThPWRMgAkh/yOEYEdfDrEPOcBCE5+vE6U+5ZKjJjnHAAp0+SHR0RxhoP2ATxxfEyTXxMQ8sAbVpTOzcXkKFnVOeRXxYQ8AEh7W3jJj/Qxjo8e+eHljs9OBsK2gTlsmIk0PkqVcZb19pANIMf8IuSXcTYXp1DVJV3GyS/b8OiPUTEAaSGD/LJD7fyanGcEQIqbX3TJIL90cW1lzbyCOAAI7aW4magAJ78l36wjPDr3Wxj5gRWiIzIcpGdhfx9gI9U7Y6tf1dtwYGeNQibIL31cjVe0vSlJt48tGthJtoc4+WWXFtkF3Bp2N2N2oKRDLj4Ga2vftat7t1D7w8FCs+VAsrjGPTxIp7hKXBel5UCO5amk1HVkWtvpDVowguXIAfvjcdNCSG5xYFBKKfLlCS0YGNKz8C2LY9t26X3TwnyPv19wlZ6f3PUZS5mZ7JUeCeUplX5YBAegac6s73VeJj8/JLYYdYr8zF54SVZZ5Rr+99eoSs8gP7OC58mLpaM2D4Y9oMrCx20FT2Umhq3JJb89BIVcJj6uQyEpIC/ShNRSKUUgqNJzyW8zXEI2W9QCgHz+AVfpRTb5cX+rFHTYAUNa1eTL7/iKaryXfrrcSG/n849bcnd/L0K1AnLX1pOvXtNKxDGAraj6QOg4Y77iGomvXoM59hnv8Tvwhdxhxto9eE0Ioc1s3e5z8WPyl6gfltHDx3K/g0RLiRSDcbtznhNEBF5B8mW5CYuX99Qnv3k/3Sl8wUBYy8FWK5VrxljKcyMlXbFXzeDKngpSQqYaJWz3mclYlQSSNrAI5jTSUnsFxdqtPhgfCmy9FBS8ZoSxw4GNJtJSh7az1eFrqiSrbCOMS35WVnfoaquLT3uFzOLlT28P5Gd1IaoSFMipjr2Fypb4B/Kz6BYCYFhalr+I26V4Dejjtwj5zcdXKEe3h/JVytt0zcsvEMPVGNnB3GDKG0QfG543Fj1Kn92IF/sNEK7T5VqfMLCo8DPd+vQQg5fACgYl0sGRMBGta5Ag9HG0pY4bkRWyLMuFA2VgIvT5hO0j4u96eofl6nCG5PrN54/vEoIB/Y2FYZhlkXSOvjxv64porf/EFQ31prsg0JeTKLP/T8HuGonWWr+LkwhWKZMLPtPdIKIU0VrrjzjCsEhLrSWyuea9kaZ5GzCitdbPgW6JtZQsbq4BL9NL5P35Dy6VtHEa3VHxAAAAAElFTkSuQmCC');}
|
||||
.coupon-list .item .money.moneyGray,.coupons .list .item .price.moneyGray{background-color: #ccc;}
|
||||
.coupon-list .item .money .num{font-size:60rpx;}
|
||||
.coupon-list .item .text{width:470rpx;padding:0 17rpx 0 24rpx;box-sizing:border-box;background-color:#fff;}
|
||||
.coupon-list .item .text{width:470rpx;padding:6rpx 17rpx 0 24rpx;box-sizing:border-box;background-color:#fff;}
|
||||
.coupon-list .item .text .condition{font-size:30rpx;color:#282828;height:93rpx;}
|
||||
.coupon-list .item .text .data{font-size:20rpx;color:#999;height:76rpx;display: flex;flex-wrap: nowrap;}
|
||||
.coupon-list .item .text .data{font-size:20rpx;color:#999;height:70rpx;display: flex;flex-wrap: nowrap;}
|
||||
.coupon-list .item .text .data .bnt{width:136rpx;height:44rpx;border-radius:22rpx;font-size:22rpx;text-align:center;line-height:44rpx;color:#fff;}
|
||||
.coupon-list .item .text .data .bnt.gray{background:#ccc!important;}
|
||||
.coupon-list .item.svip .money{background-color: #EDBB75;}
|
||||
|
||||
|
Before Width: | Height: | Size: 17 KiB |
BIN
template/uni-app/static/easy-loadimage/loading.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
@ -14,6 +14,7 @@ lang = Cache.has('locale') ? Cache.get('locale') : navigator.language;
|
||||
const i18n = new VueI18n({
|
||||
locale: lang,
|
||||
fallbackLocale: 'zh-CN',
|
||||
messages: uni.getStorageSync('localeJson')
|
||||
messages: uni.getStorageSync('localeJson'),
|
||||
silentTranslationWarn: true, // 去除国际化警告
|
||||
})
|
||||
export default i18n
|
||||
|
||||