修改返利状态,视频样式
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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -368,7 +329,10 @@
|
||||||
<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 {
|
||||||
|
mapGetters,
|
||||||
|
mapActions
|
||||||
|
} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
comment,
|
comment,
|
||||||
|
|
@ -486,7 +450,10 @@ export default {
|
||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad({ skuId, showShrough }) {
|
onLoad({
|
||||||
|
skuId,
|
||||||
|
showShrough
|
||||||
|
}) {
|
||||||
if (showShrough) {
|
if (showShrough) {
|
||||||
this.showShrough = showShrough;
|
this.showShrough = showShrough;
|
||||||
}
|
}
|
||||||
|
|
@ -511,12 +478,10 @@ export default {
|
||||||
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,
|
||||||
},
|
},
|
||||||
|
|
@ -709,6 +673,7 @@ export default {
|
||||||
.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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ const ALLACCOUNTS = "app_accounts"
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
return {
|
return {
|
||||||
token: uni.getStorageSync(TOKEN),
|
token: uni.getStorageSync(TOKEN),
|
||||||
|
// token: '1104|nAMfPQH3HTnb4Y6p06mgIbPjPNC9Hqb24sbglwfQ',
|
||||||
user: null, //用户信息
|
user: null, //用户信息
|
||||||
news_num: 0, //消息数
|
news_num: 0, //消息数
|
||||||
order_count: null, //订单数量
|
order_count: null, //订单数量
|
||||||
|
|
@ -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, {
|
||||||
|
|
@ -112,7 +120,10 @@ const actions = {
|
||||||
...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,7 +173,14 @@ 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
|
||||||
|
|
@ -167,7 +189,13 @@ const actions = {
|
||||||
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