修改返利状态,视频样式
parent
f18fe8a08f
commit
15ba1ce3c6
|
|
@ -1,17 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-30rpx pt-20rpx">
|
<view class="px-30rpx pt-20rpx">
|
||||||
<view class="sticky top-0 z-1500 bg-hex-F5F5F5 rounded-full grid grid-cols-3 text-28rpx text-hex-333 leading-40rpx py-10rpx">
|
<view
|
||||||
|
class="sticky top-0 z-1500 bg-hex-F5F5F5 rounded-full grid grid-cols-3 text-28rpx text-hex-333 leading-40rpx py-10rpx">
|
||||||
<view class="text-center">时间</view>
|
<view class="text-center">时间</view>
|
||||||
<view class="text-center">返利</view>
|
<view class="text-center">返利</view>
|
||||||
<view class="text-center">状态</view>
|
<view class="text-center">状态</view>
|
||||||
</view>
|
</view>
|
||||||
<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
|
<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
||||||
:up="upOption">
|
:down="downOption" :up="upOption">
|
||||||
<block v-for="(item,index) in dataList" :key="index">
|
<block v-for="(item,index) in dataList" :key="index">
|
||||||
<view class="grid grid-cols-3 text-28rpx text-h666 py-18rpx mt-16rpx ">
|
<view class="grid grid-cols-3 text-28rpx text-h666 py-18rpx mt-16rpx ">
|
||||||
<view class="text-center line-1 ">{{item.created_at*1000 | date('yyyy-mm-dd')}}</view>
|
<view class="text-center line-1 ">{{item.created_at*1000 | date('yyyy-mm-dd')}}</view>
|
||||||
<view class="text-center price-text">{{item.money}}</view>
|
<view class="text-center price-text">{{item.money}}</view>
|
||||||
<view class="text-center ">{{item.status |StatusText}}</view>
|
<!-- <view class="text-center ">{{item.status |StatusText}}</view> -->
|
||||||
|
<view class="text-center ">{{item.status_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<u-line></u-line>
|
<u-line></u-line>
|
||||||
</block>
|
</block>
|
||||||
|
|
@ -37,8 +39,8 @@
|
||||||
dataList: [], //获取到的数据
|
dataList: [], //获取到的数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters:{
|
filters: {
|
||||||
StatusText(value){
|
StatusText(value) {
|
||||||
const status = [{
|
const status = [{
|
||||||
value: 0,
|
value: 0,
|
||||||
label: '待付款'
|
label: '待付款'
|
||||||
|
|
@ -56,7 +58,7 @@
|
||||||
return obj?.label ?? value
|
return obj?.label ?? value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed: {
|
||||||
height() {
|
height() {
|
||||||
const {
|
const {
|
||||||
windowHeight,
|
windowHeight,
|
||||||
|
|
@ -81,7 +83,7 @@
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.mescroll.endSuccess(res.data.length)
|
this.mescroll.endSuccess(res.data.length)
|
||||||
if (page.num == 1) this.dataList = [];
|
if (page.num == 1) this.dataList = [];
|
||||||
this.dataList = this.dataList.concat(res.data,);
|
this.dataList = this.dataList.concat(res.data, );
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.mescroll.endErr()
|
this.mescroll.endErr()
|
||||||
})
|
})
|
||||||
|
|
@ -91,7 +93,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page{
|
page {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -29,43 +29,24 @@
|
||||||
</cu-swiper> -->
|
</cu-swiper> -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<block v-if="!playShow">
|
<block v-if="!playShow">
|
||||||
<swiper
|
<swiper class="swipers h-750rpx" circular="true" autoplay="true" indicator-dots="true"
|
||||||
class="swipers h-750rpx"
|
indicator-color="#ffffff" indicator-active-color="#82848a">
|
||||||
circular="true"
|
|
||||||
autoplay="true"
|
|
||||||
indicator-dots="true"
|
|
||||||
indicator-color="#ffffff"
|
|
||||||
indicator-active-color="#82848a"
|
|
||||||
>
|
|
||||||
<swiper-item class="flex justify-center w-full h-full" v-for="(item, index) in bannerList" :key="index">
|
<swiper-item class="flex justify-center w-full h-full" v-for="(item, index) in bannerList" :key="index">
|
||||||
<view class="w-full h-full relative">
|
<view class="w-full h-full relative">
|
||||||
<image
|
<image v-if="item.type == 'video'" class="w-90rpx h-90rpx translate-center z-40"
|
||||||
v-if="item.type == 'video'"
|
src="/static/images/icon_play.png" @tap="playVideo" />
|
||||||
class="w-90rpx h-90rpx translate-center z-40"
|
<image class="w-full h-full" :src="`${item.image}?x-oss-process=image/resize,w_750/quality,q_90`"
|
||||||
src="/static/images/icon_play.png"
|
mode="aspectFill" />
|
||||||
@tap="playVideo"
|
|
||||||
/>
|
|
||||||
<image class="w-full h-full" :src="`${item.image}?x-oss-process=image/resize,w_750/quality,q_90`" mode="aspectFill" />
|
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</block>
|
</block>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view class="relative" v-else>
|
<view class="relative" v-else>
|
||||||
<video
|
<video class="w-750rpx h-750rpx" :enable-progress-gesture="false" id="myVideo" v-if="media.length"
|
||||||
object-fit="object-fit"
|
:src="`${media[0]}`" controls>
|
||||||
class="w-750rpx h-750rpx"
|
<cover-image @click="pauseVideo" class="absolute right-30rpx top-30rpx w-60rpx h-60rpx"
|
||||||
:enable-progress-gesture="false"
|
src="/static/images/app/app_update_close.png"></cover-image>
|
||||||
id="myVideo"
|
|
||||||
v-if="media.length"
|
|
||||||
:src="`${media[0]}`"
|
|
||||||
controls
|
|
||||||
>
|
|
||||||
<cover-image
|
|
||||||
@click="pauseVideo"
|
|
||||||
class="absolute right-30rpx top-30rpx w-60rpx h-60rpx"
|
|
||||||
src="/static/images/app/app_update_close.png"
|
|
||||||
></cover-image>
|
|
||||||
</video>
|
</video>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -74,9 +55,8 @@
|
||||||
<view class="text-txBase text-lg pt-base">{{ detail.name }}</view>
|
<view class="text-txBase text-lg pt-base">{{ detail.name }}</view>
|
||||||
<view class="flex items-center mt-10rpx" v-if="!isPoints">
|
<view class="flex items-center mt-10rpx" v-if="!isPoints">
|
||||||
<!-- <view class="text-md text-txGray">{{ detail.subtitle }}</view> -->
|
<!-- <view class="text-md text-txGray">{{ detail.subtitle }}</view> -->
|
||||||
<view class="px-13rpx bg-primary bg-opacity-20 text-md rounded-10rpx text-primary" v-if="detail.sales_value"
|
<view class="px-13rpx bg-primary bg-opacity-20 text-md rounded-10rpx text-primary"
|
||||||
>成长值:{{ detail.sales_value }}</view
|
v-if="detail.sales_value">成长值:{{ detail.sales_value }}</view>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex items-center justify-between">
|
<view class="flex items-center justify-between">
|
||||||
<view class="text-txBase text-md flex items-center">
|
<view class="text-txBase text-md flex items-center">
|
||||||
|
|
@ -88,12 +68,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="flex items-center mt-base">
|
<view class="flex items-center mt-base">
|
||||||
<!-- <image class="w-36rpx h-36rpx" src="/static/images/user/collection.png" mode=""></image> -->
|
<!-- <image class="w-36rpx h-36rpx" src="/static/images/user/collection.png" mode=""></image> -->
|
||||||
<u-icon
|
<u-icon :color="products.is_collected ? '#FC8720' : ''" size="36"
|
||||||
:color="products.is_collected ? '#FC8720' : ''"
|
:name="products.is_collected ? 'star-fill' : 'star'" @tap="onCollection"></u-icon>
|
||||||
size="36"
|
|
||||||
:name="products.is_collected ? 'star-fill' : 'star'"
|
|
||||||
@tap="onCollection"
|
|
||||||
></u-icon>
|
|
||||||
<view class="text-txBase text-md ml-10rpx leading-0">收藏</view>
|
<view class="text-txBase text-md ml-10rpx leading-0">收藏</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -103,7 +79,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view class="flex items-center justify-between bg-white px-41rpx py-32rpx" @tap="showSpecFun(0)" v-if="specs.length && !isPoints">
|
<view class="flex items-center justify-between bg-white px-41rpx py-32rpx" @tap="showSpecFun(0)"
|
||||||
|
v-if="specs.length && !isPoints">
|
||||||
<view class="flex items-center text-txBase text-md">
|
<view class="flex items-center text-txBase text-md">
|
||||||
<view class="font-extrabold">选择</view>
|
<view class="font-extrabold">选择</view>
|
||||||
<view class="ml-base">{{ activeSkuText }}</view>
|
<view class="ml-base">{{ activeSkuText }}</view>
|
||||||
|
|
@ -179,26 +156,19 @@
|
||||||
<view class="flex pb-20rpx items-center">
|
<view class="flex pb-20rpx items-center">
|
||||||
<view class="flex rtl">
|
<view class="flex rtl">
|
||||||
<view
|
<view
|
||||||
class="rounded-full w-90rpx h-90rpx bg-hex-cacaca border border-4rpx border-hex-fff box-content flex items-center justify-center"
|
class="rounded-full w-90rpx h-90rpx bg-hex-cacaca border border-4rpx border-hex-fff box-content flex items-center justify-center">
|
||||||
>
|
|
||||||
<u-icon name="plus" color="#ffffff" size="40"></u-icon>
|
<u-icon name="plus" color="#ffffff" size="40"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="rounded-full w-90rpx h-90rpx bg-rose-100 border border-4rpx border-hex-fff box-content"
|
||||||
class="rounded-full w-90rpx h-90rpx bg-rose-100 border border-4rpx border-hex-fff box-content"
|
v-for="(item, index) in bargainLogs" :key="index"
|
||||||
v-for="(item, index) in bargainLogs"
|
:class="{ '-ml-30rpx': index != bargainLogs.length - 1 }">
|
||||||
:key="index"
|
|
||||||
:class="{ '-ml-30rpx': index != bargainLogs.length - 1 }"
|
|
||||||
>
|
|
||||||
<u-avatar :size="90" :src="item.avatar"></u-avatar>
|
<u-avatar :size="90" :src="item.avatar"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-1"></view>
|
<view class="flex-1"></view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view
|
<view class="bg-hex-e81300 rounded-8rpx px-40rpx h-60rpx leading-60rpx text-white text-30rpx"
|
||||||
class="bg-hex-e81300 rounded-8rpx px-40rpx h-60rpx leading-60rpx text-white text-30rpx"
|
@click="$u.routeAuth('/pages/bargain/invite', { skuId: skuId })">邀请好友</view>
|
||||||
@click="$u.routeAuth('/pages/bargain/invite', { skuId: skuId })"
|
|
||||||
>邀请好友</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -280,25 +250,26 @@
|
||||||
<!-- 底部导航栏 -->
|
<!-- 底部导航栏 -->
|
||||||
<view class="flex items-center fixed right-0 left-0 bottom-0 bottom w-full bg-white shadow cu-bar tabbar">
|
<view class="flex items-center fixed right-0 left-0 bottom-0 bottom w-full bg-white shadow cu-bar tabbar">
|
||||||
<block v-if="isPoints">
|
<block v-if="isPoints">
|
||||||
<view class="mx-base bg-bgSubtitle rounded-lg w-full h-66rpx text-center leading-66rpx text-md text-white" @click="onDHClick">兑换</view>
|
<view class="mx-base bg-bgSubtitle rounded-lg w-full h-66rpx text-center leading-66rpx text-md text-white"
|
||||||
|
@click="onDHClick">兑换</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="w-300rpx flex justify-around ml-20rpx">
|
<view class="w-300rpx flex justify-around ml-20rpx">
|
||||||
<view class="flex items-center justify-center h-full flex-col flex-1" @tap="$u.routeAuth('/pages/auxiliary_cart/index')">
|
<view class="flex items-center justify-center h-full flex-col flex-1"
|
||||||
|
@tap="$u.routeAuth('/pages/auxiliary_cart/index')">
|
||||||
<view class="relative w-48rpx h-48rpx flex justify-center items-center">
|
<view class="relative w-48rpx h-48rpx flex justify-center items-center">
|
||||||
<image class="w-full h-full" src="/static/images/cart/short-cart.png" mode="scaleToFill" />
|
<image class="w-full h-full" src="/static/images/cart/short-cart.png" mode="scaleToFill" />
|
||||||
<view
|
<view v-if="cartList.length"
|
||||||
v-if="cartList.length"
|
class="absolute -right-24rpx -top-10rpx leading-36rpx text-sm text-bgSubtitle bg-white text-center w-36rpx h-36rpx border border-b border-txBorder border-txbordergSubtitle rounded-full">
|
||||||
class="absolute -right-24rpx -top-10rpx leading-36rpx text-sm text-bgSubtitle bg-white text-center w-36rpx h-36rpx border border-b border-txBorder border-txbordergSubtitle rounded-full"
|
|
||||||
>
|
|
||||||
{{ cartList.length }}
|
{{ cartList.length }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-26rpx mt-10rpx">购物车</view>
|
<view class="text-26rpx mt-10rpx">购物车</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<view class="flex items-center justify-center flex-col h-full flex-1" @tap="$u.route(`/pages/web_view/index?url=${service}`)">
|
<view class="flex items-center justify-center flex-col h-full flex-1"
|
||||||
|
@tap="$u.route(`/pages/web_view/index?url=${service}`)">
|
||||||
<view class="w-48rpx h-48rpx flex justify-center items-center">
|
<view class="w-48rpx h-48rpx flex justify-center items-center">
|
||||||
<u-icon name="kefu-ermai" color="#000" size="48"></u-icon>
|
<u-icon name="kefu-ermai" color="#000" size="48"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -306,7 +277,8 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<button open-type="contact" hover-class="none" class="cu-btn flex items-center justify-center flex-col h-full flex-1">
|
<button open-type="contact" hover-class="none"
|
||||||
|
class="cu-btn flex items-center justify-center flex-col h-full flex-1">
|
||||||
<view class="w-48rpx h-48rpx flex justify-center items-center">
|
<view class="w-48rpx h-48rpx flex justify-center items-center">
|
||||||
<u-icon name="kefu-ermai" color="#000" size="48"></u-icon>
|
<u-icon name="kefu-ermai" color="#000" size="48"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -325,12 +297,11 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="flex items-center justify-center flex-1">
|
<view class="flex items-center justify-center flex-1">
|
||||||
<view class="bg-primary rounded-lg w-180rpx h-66rpx text-center leading-66rpx text-md text-white" @tap="showSpecFun(1)"
|
<view class="bg-primary rounded-lg w-180rpx h-66rpx text-center leading-66rpx text-md text-white"
|
||||||
>加入购物车</view
|
@tap="showSpecFun(1)">加入购物车</view>
|
||||||
>
|
<view
|
||||||
<view class="ml-base bg-bgSubtitle rounded-lg w-180rpx h-66rpx text-center leading-66rpx text-md text-white" @tap="showSpecFun(2)"
|
class="ml-base bg-bgSubtitle rounded-lg w-180rpx h-66rpx text-center leading-66rpx text-md text-white"
|
||||||
>立即购买</view
|
@tap="showSpecFun(2)">立即购买</view>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -345,20 +316,10 @@
|
||||||
|
|
||||||
<u-skeleton :loading="isFirstLoading" :animation="true" bgColor="#FFF"></u-skeleton>
|
<u-skeleton :loading="isFirstLoading" :animation="true" bgColor="#FFF"></u-skeleton>
|
||||||
|
|
||||||
<spec-popup
|
<spec-popup :loading="loading" :specs="specs" :sku="detail" v-model="show" :quota-used="number"
|
||||||
:loading="loading"
|
:show-cart="popupType == 1 || popupType == 0" :show-buy="popupType == 2 || popupType == 0"
|
||||||
:specs="specs"
|
:show-confirm="popupType == 3" @stepper-change="onChangeNumber" @sku-selected="onChangeSku" @buy-clicked="onBuy"
|
||||||
:sku="detail"
|
@add-cart="onAddCart">
|
||||||
v-model="show"
|
|
||||||
:quota-used="number"
|
|
||||||
:show-cart="popupType == 1 || popupType == 0"
|
|
||||||
:show-buy="popupType == 2 || popupType == 0"
|
|
||||||
:show-confirm="popupType == 3"
|
|
||||||
@stepper-change="onChangeNumber"
|
|
||||||
@sku-selected="onChangeSku"
|
|
||||||
@buy-clicked="onBuy"
|
|
||||||
@add-cart="onAddCart"
|
|
||||||
>
|
|
||||||
</spec-popup>
|
</spec-popup>
|
||||||
<!-- 分享弹窗 -->
|
<!-- 分享弹窗 -->
|
||||||
<sharePopup v-model="shareShow" :goods="detail" :goodsImage="goodsImage"></sharePopup>
|
<sharePopup v-model="shareShow" :goods="detail" :goodsImage="goodsImage"></sharePopup>
|
||||||
|
|
@ -366,10 +327,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import comment from '@/components/comment/comment';
|
import comment from '@/components/comment/comment';
|
||||||
import sharePopup from './components/share-popup.vue';
|
import sharePopup from './components/share-popup.vue';
|
||||||
import { mapGetters, mapActions } from 'vuex';
|
import {
|
||||||
export default {
|
mapGetters,
|
||||||
|
mapActions
|
||||||
|
} from 'vuex';
|
||||||
|
export default {
|
||||||
components: {
|
components: {
|
||||||
comment,
|
comment,
|
||||||
sharePopup,
|
sharePopup,
|
||||||
|
|
@ -395,10 +359,10 @@ export default {
|
||||||
playShow: false,
|
playShow: false,
|
||||||
shareShow: false,
|
shareShow: false,
|
||||||
goodsImage: '', //本地图片
|
goodsImage: '', //本地图片
|
||||||
style:{
|
style: {
|
||||||
p: 'font-size:0',
|
p: 'font-size:0',
|
||||||
span: 'font-size: 0',
|
span: 'font-size: 0',
|
||||||
img:'display:block;min-width:100%'
|
img: 'display:block;min-width:100%'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -475,18 +439,21 @@ export default {
|
||||||
return '请选择规格';
|
return '请选择规格';
|
||||||
},
|
},
|
||||||
//是否积分兑换
|
//是否积分兑换
|
||||||
isPoints(){
|
isPoints() {
|
||||||
return this.detail.redeem_points > 0
|
return this.detail.redeem_points > 0
|
||||||
},
|
},
|
||||||
priceText(){
|
priceText() {
|
||||||
let price = ''
|
let price = ''
|
||||||
if(this.detail.sell_price > 0) price+=`¥${parseFloat(this.detail.sell_price)}`
|
if (this.detail.sell_price > 0) price += `¥${parseFloat(this.detail.sell_price)}`
|
||||||
if(this.detail.sell_price > 0 && this.detail.redeem_points > 0) price+='+'
|
if (this.detail.sell_price > 0 && this.detail.redeem_points > 0) price += '+'
|
||||||
if(this.detail.redeem_points > 0) price+=`${this.detail.redeem_points} 积分`
|
if (this.detail.redeem_points > 0) price += `${this.detail.redeem_points} 积分`
|
||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad({ skuId, showShrough }) {
|
onLoad({
|
||||||
|
skuId,
|
||||||
|
showShrough
|
||||||
|
}) {
|
||||||
if (showShrough) {
|
if (showShrough) {
|
||||||
this.showShrough = showShrough;
|
this.showShrough = showShrough;
|
||||||
}
|
}
|
||||||
|
|
@ -509,14 +476,12 @@ export default {
|
||||||
return shareObj;
|
return shareObj;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onDHClick(){
|
onDHClick() {
|
||||||
const params = {
|
const params = {
|
||||||
goods: [
|
goods: [{
|
||||||
{
|
|
||||||
sku_id: this.skuId,
|
sku_id: this.skuId,
|
||||||
num: 1,
|
num: 1,
|
||||||
},
|
}, ],
|
||||||
],
|
|
||||||
type: 'points'
|
type: 'points'
|
||||||
};
|
};
|
||||||
this.$u.routeAuth('/pages/confirm_order/confirm_order?data=' + encodeURIComponent(JSON.stringify(params)));
|
this.$u.routeAuth('/pages/confirm_order/confirm_order?data=' + encodeURIComponent(JSON.stringify(params)));
|
||||||
|
|
@ -576,27 +541,26 @@ export default {
|
||||||
//购买
|
//购买
|
||||||
onBuy() {
|
onBuy() {
|
||||||
const params = {
|
const params = {
|
||||||
goods: [
|
goods: [{
|
||||||
{
|
|
||||||
sku_id: this.skuId,
|
sku_id: this.skuId,
|
||||||
num: this.number,
|
num: this.number,
|
||||||
},
|
}, ],
|
||||||
],
|
|
||||||
};
|
};
|
||||||
this.show = false;
|
this.show = false;
|
||||||
this.$u.routeAuth('/pages/confirm_order/confirm_order?data=' + encodeURIComponent(JSON.stringify(params)));
|
this.$u.routeAuth('/pages/confirm_order/confirm_order?data=' + encodeURIComponent(JSON.stringify(params)));
|
||||||
},
|
},
|
||||||
//添加购物车
|
//添加购物车
|
||||||
async onAddCart(e) {
|
async onAddCart(e) {
|
||||||
const { skuId, number } = this;
|
const {
|
||||||
|
skuId,
|
||||||
|
number
|
||||||
|
} = this;
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch(
|
await this.$store.dispatch(
|
||||||
'goods/addCart',
|
'goods/addCart', {
|
||||||
{
|
|
||||||
skuId,
|
skuId,
|
||||||
number,
|
number,
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
custom: {
|
custom: {
|
||||||
loading: true,
|
loading: true,
|
||||||
},
|
},
|
||||||
|
|
@ -702,32 +666,33 @@ export default {
|
||||||
this.show = !e;
|
this.show = !e;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.border-hex-fff {
|
.border-hex-fff {
|
||||||
border: 1px solid #fff !important;
|
border: 1px solid #fff !important;
|
||||||
}
|
}
|
||||||
.share-btn::after {
|
|
||||||
|
.share-btn::after {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shadow {
|
.shadow {
|
||||||
box-shadow: 0px -4rpx 10rpx rgba(0, 0, 0, 0.11);
|
box-shadow: 0px -4rpx 10rpx rgba(0, 0, 0, 0.11);
|
||||||
}
|
}
|
||||||
|
|
||||||
.shadowRight {
|
.shadowRight {
|
||||||
box-shadow: 2rpx 0px 5rpx rgba(0, 0, 0, 0.12);
|
box-shadow: 2rpx 0px 5rpx rgba(0, 0, 0, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
@apply bg-badge;
|
@apply bg-badge;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fontFam {
|
.fontFam {
|
||||||
/* #ifdef APP-PLUS */
|
/* #ifdef APP-PLUS */
|
||||||
font-family: '宋体';
|
font-family: '宋体';
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,12 @@ const ALLACCOUNTS = "app_accounts"
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
return {
|
return {
|
||||||
token: uni.getStorageSync(TOKEN),
|
token: uni.getStorageSync(TOKEN),
|
||||||
user: null,//用户信息
|
// token: '1104|nAMfPQH3HTnb4Y6p06mgIbPjPNC9Hqb24sbglwfQ',
|
||||||
news_num: 0,//消息数
|
user: null, //用户信息
|
||||||
order_count: null,//订单数量
|
news_num: 0, //消息数
|
||||||
history: uni.getStorageSync(HISTORY) || [],//历史搜索
|
order_count: null, //订单数量
|
||||||
allaccounts: uni.getStorageSync(ALLACCOUNTS) || [],//所有账号
|
history: uni.getStorageSync(HISTORY) || [], //历史搜索
|
||||||
|
allaccounts: uni.getStorageSync(ALLACCOUNTS) || [], //所有账号
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -26,10 +27,10 @@ const mutations = {
|
||||||
Object.assign(state, getDefaultState())
|
Object.assign(state, getDefaultState())
|
||||||
},
|
},
|
||||||
async LOGIN(state, value) {
|
async LOGIN(state, value) {
|
||||||
await this.commit('user/SET_TOKEN',value)
|
await this.commit('user/SET_TOKEN', value)
|
||||||
await this.dispatch('user/getUserInfo',false)
|
await this.dispatch('user/getUserInfo', false)
|
||||||
},
|
},
|
||||||
LOGOUT(){
|
LOGOUT() {
|
||||||
return this.dispatch('user/resetToken')
|
return this.dispatch('user/resetToken')
|
||||||
},
|
},
|
||||||
// 登录
|
// 登录
|
||||||
|
|
@ -52,7 +53,9 @@ const mutations = {
|
||||||
if (state.history.length == 0) {
|
if (state.history.length == 0) {
|
||||||
state.history.unshift(value)
|
state.history.unshift(value)
|
||||||
} else {
|
} else {
|
||||||
let Index = state.history.findIndex(item => { return item == value })
|
let Index = state.history.findIndex(item => {
|
||||||
|
return item == value
|
||||||
|
})
|
||||||
if (Index == -1) {
|
if (Index == -1) {
|
||||||
state.history.unshift(value)
|
state.history.unshift(value)
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +74,9 @@ const mutations = {
|
||||||
},
|
},
|
||||||
//修改资料后改变用户信息
|
//修改资料后改变用户信息
|
||||||
SET_REFRESH(state, value) {
|
SET_REFRESH(state, value) {
|
||||||
let Index = state.allaccounts.findIndex(item => { return item.phone == value.phone })
|
let Index = state.allaccounts.findIndex(item => {
|
||||||
|
return item.phone == value.phone
|
||||||
|
})
|
||||||
if (Index != -1) {
|
if (Index != -1) {
|
||||||
state.allaccounts[Index].phone = value.phone
|
state.allaccounts[Index].phone = value.phone
|
||||||
state.allaccounts[Index].avatar = value.avatar
|
state.allaccounts[Index].avatar = value.avatar
|
||||||
|
|
@ -97,7 +102,10 @@ const actions = {
|
||||||
commit,
|
commit,
|
||||||
state,
|
state,
|
||||||
dispatch
|
dispatch
|
||||||
}, { form, switchAllaccounts }) {
|
}, {
|
||||||
|
form,
|
||||||
|
switchAllaccounts
|
||||||
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
http.post('/v1/login', form, {
|
http.post('/v1/login', form, {
|
||||||
|
|
@ -107,12 +115,15 @@ const actions = {
|
||||||
}).then(({
|
}).then(({
|
||||||
token
|
token
|
||||||
}) => {
|
}) => {
|
||||||
if(switchAllaccounts && state.allaccounts.length==0){
|
if (switchAllaccounts && state.allaccounts.length == 0) {
|
||||||
const tempUserInfo = {
|
const tempUserInfo = {
|
||||||
...Object.assign({},state.user),
|
...Object.assign({}, state.user),
|
||||||
token:state.token,
|
token: state.token,
|
||||||
}
|
}
|
||||||
dispatch('getAccounts', { info:tempUserInfo, switchAllaccounts })
|
dispatch('getAccounts', {
|
||||||
|
info: tempUserInfo,
|
||||||
|
switchAllaccounts
|
||||||
|
})
|
||||||
}
|
}
|
||||||
resolve(token)
|
resolve(token)
|
||||||
commit('SET_TOKEN', token)
|
commit('SET_TOKEN', token)
|
||||||
|
|
@ -150,7 +161,11 @@ const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
getUserInfo({ commit, state, dispatch }, switchAllaccounts) {
|
getUserInfo({
|
||||||
|
commit,
|
||||||
|
state,
|
||||||
|
dispatch
|
||||||
|
}, switchAllaccounts) {
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!state.token) return
|
if (!state.token) return
|
||||||
|
|
@ -158,16 +173,29 @@ const actions = {
|
||||||
custom: {
|
custom: {
|
||||||
silence: true
|
silence: true
|
||||||
}
|
}
|
||||||
}).then(({ phone, user_info, is_vip, wallet, balance,vip_expired }) => {
|
}).then(({
|
||||||
|
phone,
|
||||||
|
user_info,
|
||||||
|
is_vip,
|
||||||
|
wallet,
|
||||||
|
balance,
|
||||||
|
vip_expired
|
||||||
|
}) => {
|
||||||
let user = user_info
|
let user = user_info
|
||||||
user.phone = phone
|
user.phone = phone
|
||||||
user.is_vip = is_vip
|
user.is_vip = is_vip
|
||||||
user.wallet = wallet
|
user.wallet = wallet
|
||||||
user.balance = balance
|
user.balance = balance
|
||||||
user.vip_expired=vip_expired
|
user.vip_expired = vip_expired
|
||||||
commit('SET_USERINFO', user)
|
commit('SET_USERINFO', user)
|
||||||
dispatch('bindCid')
|
dispatch('bindCid')
|
||||||
dispatch('getAccounts', { info: { ...user, token: state.token }, switchAllaccounts })
|
dispatch('getAccounts', {
|
||||||
|
info: {
|
||||||
|
...user,
|
||||||
|
token: state.token
|
||||||
|
},
|
||||||
|
switchAllaccounts
|
||||||
|
})
|
||||||
resolve(user)
|
resolve(user)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
reject(err)
|
reject(err)
|
||||||
|
|
@ -175,7 +203,13 @@ const actions = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getAccounts({ commit, state }, { info, switchAllaccounts = false }) {
|
getAccounts({
|
||||||
|
commit,
|
||||||
|
state
|
||||||
|
}, {
|
||||||
|
info,
|
||||||
|
switchAllaccounts = false
|
||||||
|
}) {
|
||||||
|
|
||||||
const obj = {
|
const obj = {
|
||||||
avatar: info.avatar,
|
avatar: info.avatar,
|
||||||
|
|
@ -194,7 +228,9 @@ const actions = {
|
||||||
}
|
}
|
||||||
commit('SET_ACCOUNTS', all)
|
commit('SET_ACCOUNTS', all)
|
||||||
},
|
},
|
||||||
resetToken({ commit }) {
|
resetToken({
|
||||||
|
commit
|
||||||
|
}) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
uni.removeStorageSync(TOKEN);
|
uni.removeStorageSync(TOKEN);
|
||||||
commit('RESET_STATE')
|
commit('RESET_STATE')
|
||||||
|
|
@ -204,19 +240,30 @@ const actions = {
|
||||||
bindCid() {
|
bindCid() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
const cid = plus.push.getClientInfo()?.clientid
|
const cid = plus.push.getClientInfo()?.clientid
|
||||||
http.post('/v1/push-bind-uni', { cid }, { custom: { toast: false } })
|
http.post('/v1/push-bind-uni', {
|
||||||
|
cid
|
||||||
|
}, {
|
||||||
|
custom: {
|
||||||
|
toast: false
|
||||||
|
}
|
||||||
|
})
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
//异步获取消息未读数
|
//异步获取消息未读数
|
||||||
getNewsNum({ commit, state }) {
|
getNewsNum({
|
||||||
|
commit,
|
||||||
|
state
|
||||||
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!state.token) return
|
if (!state.token) return
|
||||||
http.get('/v1/messages/wait-read-num', {}, {
|
http.get('/v1/messages/wait-read-num', {}, {
|
||||||
custom: {
|
custom: {
|
||||||
silence: true
|
silence: true
|
||||||
}
|
}
|
||||||
}).then(({ num }) => {
|
}).then(({
|
||||||
|
num
|
||||||
|
}) => {
|
||||||
commit('SET_NEWS', num)
|
commit('SET_NEWS', num)
|
||||||
resolve(num)
|
resolve(num)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
@ -225,7 +272,10 @@ const actions = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取订单数量
|
//获取订单数量
|
||||||
getOrderNum({ commit, state }) {
|
getOrderNum({
|
||||||
|
commit,
|
||||||
|
state
|
||||||
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!state.token) return
|
if (!state.token) return
|
||||||
http.get('/v1/order/statistics').then(res => {
|
http.get('/v1/order/statistics').then(res => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue