Merge remote-tracking branch 'origin/master-vue3' into master-vue3

pull/32/head
owen 2023-12-23 22:29:33 +08:00
commit 52299cf7ba
49 changed files with 906 additions and 900 deletions

15
App.vue
View File

@ -1,12 +1,6 @@
<script setup> <script setup>
import { import { onLaunch, onShow, onError } from '@dcloudio/uni-app';
onLaunch, import { ShoproInit } from './sheep';
onShow,
onError
} from '@dcloudio/uni-app';
import {
ShoproInit
} from './sheep';
onLaunch(() => { onLaunch(() => {
// 使 // 使
@ -24,7 +18,8 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
// urlSchemes // urlSchemes
const args = plus.runtime.arguments; const args = plus.runtime.arguments;
if (args) {} if (args) {
}
// //
uni.getClipboardData({ uni.getClipboardData({
@ -36,8 +31,6 @@
// //
console.log(options,'options'); console.log(options,'options');
// #endif // #endif
}); });
</script> </script>

View File

@ -5,15 +5,9 @@
<view class="ss-flex ss-row-between card-box-header"> <view class="ss-flex ss-row-between card-box-header">
<view class="ss-flex"> <view class="ss-flex">
<view class="header-title ss-m-r-16">账户信息</view> <view class="header-title ss-m-r-16">账户信息</view>
<button <button class="ss-reset-button look-btn ss-flex" @tap="state.showMoney = !state.showMoney">
class="ss-reset-button look-btn ss-flex" <uni-icons :type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'" color="#A57A55"
@tap="state.showMoney = !state.showMoney" size="20"></uni-icons>
>
<uni-icons
:type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'"
color="#A57A55"
size="20"
></uni-icons>
</button> </button>
</view> </view>
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')"> <view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
@ -24,21 +18,21 @@
<!-- 收益 --> <!-- 收益 -->
<view class="card-content ss-flex"> <view class="card-content ss-flex">
<view class="ss-flex-1 ss-flex-col ss-col-center"> <view class="ss-flex-1 ss-flex-col ss-col-center">
<view class="item-title">总收益()</view> <view class="item-title">当前佣金()</view>
<view class="item-detail"> <view class="item-detail">
{{ state.showMoney ? agentInfo.total_income || '0.00' : '***' }} {{ state.showMoney ? userInfo.brokeragePrice || '0.00' : '***' }}
</view> </view>
</view> </view>
<view class="ss-flex-1 ss-flex-col ss-col-center"> <view class="ss-flex-1 ss-flex-col ss-col-center">
<view class="item-title">的佣金()</view> <view class="item-title">昨天的佣金()</view>
<view class="item-detail"> <view class="item-detail">
{{ state.showMoney ? userInfo.commission || '0.00' : '***' }} {{ state.showMoney ? userInfo.yesterdayPrice || '0.00' : '***' }}
</view> </view>
</view> </view>
<view class="ss-flex-1 ss-flex-col ss-col-center"> <view class="ss-flex-1 ss-flex-col ss-col-center">
<view class="item-title">我的消费()</view> <view class="item-title">累计已提()</view>
<view class="item-detail"> <view class="item-detail">
{{ state.showMoney ? userInfo.total_consume || '0.00' : '***' }} {{ state.showMoney ? userInfo.withdrawPrice || '0.00' : '***' }}
</view> </view>
</view> </view>
</view> </view>
@ -48,7 +42,11 @@
<script setup> <script setup>
import sheep from '@/sheep'; import sheep from '@/sheep';
import { computed, reactive } from 'vue'; import {
computed,
reactive,
onMounted
} from 'vue';
const userInfo = computed(() => sheep.$store('user').userInfo); const userInfo = computed(() => sheep.$store('user').userInfo);
const agentInfo = computed(() => sheep.$store('user').agentInfo); const agentInfo = computed(() => sheep.$store('user').agentInfo);
@ -56,6 +54,10 @@
const state = reactive({ const state = reactive({
showMoney: false, showMoney: false,
}); });
onMounted(async () => {
let res = await sheep.$api.commission.getSummary();
userInfo = res.data;
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -67,27 +69,33 @@
border-radius: 12rpx; border-radius: 12rpx;
z-index: 3; z-index: 3;
position: relative; position: relative;
.account-card-box { .account-card-box {
background: #ffefd6; background: #ffefd6;
.card-box-header { .card-box-header {
padding: 0 30rpx; padding: 0 30rpx;
height: 72rpx; height: 72rpx;
box-shadow: 0px 2px 6px #f2debe; box-shadow: 0px 2px 6px #f2debe;
.header-title { .header-title {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #a17545; color: #a17545;
line-height: 30rpx; line-height: 30rpx;
} }
.cicon-play-arrow { .cicon-play-arrow {
color: #a17545; color: #a17545;
font-size: 24rpx; font-size: 24rpx;
line-height: 30rpx; line-height: 30rpx;
} }
} }
.card-content { .card-content {
height: 190rpx; height: 190rpx;
background: #fdfae9; background: #fdfae9;
.item-title { .item-title {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
@ -95,6 +103,7 @@
line-height: 30rpx; line-height: 30rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.item-detail { .item-detail {
font-size: 36rpx; font-size: 36rpx;
font-family: OPPOSANS; font-family: OPPOSANS;

View File

@ -11,12 +11,8 @@
<view class="user-name">{{ userInfo.nickname }}</view> <view class="user-name">{{ userInfo.nickname }}</view>
<view class="user-info-box ss-flex"> <view class="user-info-box ss-flex">
<view class="tag-box ss-flex" v-if="agentInfo.level_info"> <view class="tag-box ss-flex" v-if="agentInfo.level_info">
<image <image v-if="agentInfo.level_info?.image" class="tag-img"
v-if="agentInfo.level_info?.image" :src="sheep.$url.cdn(agentInfo.level_info?.image)" mode="aspectFill">
class="tag-img"
:src="sheep.$url.cdn(agentInfo.level_info?.image)"
mode="aspectFill"
>
</image> </image>
<text class="tag-title">{{ agentInfo.level_info?.name }}</text> <text class="tag-title">{{ agentInfo.level_info?.name }}</text>
</view> </view>
@ -31,12 +27,15 @@
<script setup> <script setup>
import sheep from '@/sheep'; import sheep from '@/sheep';
import { computed, reactive } from 'vue'; import {
computed,
reactive
} from 'vue';
const userInfo = computed(() => sheep.$store('user').userInfo); const userInfo = computed(() => sheep.$store('user').userInfo);
const agentInfo = computed(() => sheep.$store('user').agentInfo); const agentInfo = computed(() => sheep.$store('user').agentInfo);
const headerBg = sheep.$url.css('/static/img/shop/commission/background.png'); const headerBg = sheep.$url.css('/static/img/shop/commission/background.png');
console.log(userInfo);
const state = reactive({ const state = reactive({
showMoney: false, showMoney: false,
}); });
@ -74,6 +73,7 @@
.card-top { .card-top {
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 34rpx; padding-bottom: 34rpx;
.user-name { .user-name {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;

View File

@ -2,53 +2,42 @@
<template> <template>
<s-layout title="推广商品" :onShareAppMessage="state.shareInfo"> <s-layout title="推广商品" :onShareAppMessage="state.shareInfo">
<view class="goods-item ss-m-20" v-for="item in state.pagination.data" :key="item.id"> <view class="goods-item ss-m-20" v-for="item in state.pagination.data" :key="item.id">
<s-goods-item <s-goods-item size="lg" :img="item.picUrl" :title="item.name" :subTitle="item.subtitle" :price="item.price"
size="lg" :originPrice="item.original_price" priceColor="#333"
:img="item.image" @tap="sheep.$router.go('/pages/goods/index', { id: item.id })">
:title="item.title"
:subTitle="item.subtitle"
:price="item.price[0]"
:originPrice="item.original_price"
priceColor="#333"
@tap="sheep.$router.go('/pages/goods/index', { id: item.id })"
>
<template #rightBottom> <template #rightBottom>
<view class="ss-flex ss-row-between"> <view class="ss-flex ss-row-between">
<view class="commission-num">预计佣金{{ item.commission }}</view> <view class="commission-num">预计佣金{{ item.commission }}</view>
<button <button class="ss-reset-button share-btn ui-BG-Main-Gradient" @tap.stop="onShareGoods(item)">
class="ss-reset-button share-btn ui-BG-Main-Gradient"
@tap.stop="onShareGoods(item)"
>
分享赚 分享赚
</button> </button>
</view> </view>
</template> </template>
</s-goods-item> </s-goods-item>
</view> </view>
<s-empty <s-empty v-if="state.pagination.total === 0" icon="/static/goods-empty.png" text="暂无推广商品"></s-empty>
v-if="state.pagination.total === 0"
icon="/static/goods-empty.png"
text="暂无推广商品"
></s-empty>
<!-- 加载更多 --> <!-- 加载更多 -->
<uni-load-more <uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
contentdown: '上拉加载更多', contentdown: '上拉加载更多',
}" }" @tap="loadmore" />
@tap="loadmore"
/>
</s-layout> </s-layout>
</template> </template>
<script setup> <script setup>
import sheep from '@/sheep'; import sheep from '@/sheep';
import $share from '@/sheep/platform/share'; import $share from '@/sheep/platform/share';
import { onLoad, onReachBottom } from '@dcloudio/uni-app'; import {
import { computed, reactive } from 'vue'; onLoad,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive
} from 'vue';
import _ from 'lodash'; import _ from 'lodash';
import { showShareModal } from '@/sheep/hooks/useModal'; import {
showShareModal
} from '@/sheep/hooks/useModal';
const state = reactive({ const state = reactive({
pagination: { pagination: {
@ -62,8 +51,7 @@
}); });
function onShareGoods(goodsInfo) { function onShareGoods(goodsInfo) {
state.shareInfo = $share.getShareInfo( state.shareInfo = $share.getShareInfo({
{
title: goodsInfo.title, title: goodsInfo.title,
image: sheep.$url.cdn(goodsInfo.image), image: sheep.$url.cdn(goodsInfo.image),
desc: goodsInfo.subtitle, desc: goodsInfo.subtitle,
@ -71,31 +59,29 @@
page: '2', page: '2',
query: goodsInfo.id, query: goodsInfo.id,
}, },
}, }, {
{
type: 'goods', // type: 'goods', //
title: goodsInfo.title, // title: goodsInfo.title, //
image: sheep.$url.cdn(goodsInfo.image), // image: sheep.$url.cdn(goodsInfo.image), //
price: goodsInfo.price[0], // price: goodsInfo.price[0], //
original_price: goodsInfo.original_price, // original_price: goodsInfo.original_price, //
}, }, );
);
showShareModal(); showShareModal();
} }
async function getGoodsList(page = 1, list_rows = 8) { async function getGoodsList(page = 1, list_rows = 8) {
state.pagination.current_page = page;
state.loadStatus = 'loading'; state.loadStatus = 'loading';
let res = await sheep.$api.commission.goods({ let res = await sheep.$api.commission.goods({
list_rows, pageSize: list_rows,
page, pageNo: page,
}); });
if (res.error === 0) { if (res.code === 0) {
let orderList = _.concat(state.pagination.data, res.data.data); let orderList = _.concat(state.pagination.data, res.data.list);
state.pagination = { state.pagination = {
...res.data, ...res.data,
data: orderList, data: orderList,
}; };
if (state.pagination.current_page < state.pagination.last_page) { if (state.pagination.data.length < state.pagination.total) {
state.loadStatus = 'more'; state.loadStatus = 'more';
} else { } else {
state.loadStatus = 'noMore'; state.loadStatus = 'noMore';

View File

@ -1,15 +1,12 @@
<!-- 分销订单 --> <!-- 分销订单 -->
<template> <template>
<s-layout title="分销订单" :class="state.scrollTop ? 'order-warp' : ''" navbar="inner"> <s-layout title="分销订单" :class="state.scrollTop ? 'order-warp' : ''" navbar="inner">
<view <view class="header-box" :style="[
class="header-box"
:style="[
{ {
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx', marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
paddingTop: Number(statusBarHeight + 108) + 'rpx', paddingTop: Number(statusBarHeight + 108) + 'rpx',
}, },
]" ]">
>
<!-- 团队数据总览 --> <!-- 团队数据总览 -->
<view class="team-data-box ss-flex ss-col-center ss-row-between"> <view class="team-data-box ss-flex ss-col-center ss-row-between">
<view class="data-card"> <view class="data-card">
@ -76,12 +73,7 @@
<!-- tab --> <!-- tab -->
<su-sticky bgColor="#fff"> <su-sticky bgColor="#fff">
<su-tabs <su-tabs :list="tabMaps" :scrollable="false" :current="state.currentTab" @change="onTabsChange">
:list="tabMaps"
:scrollable="false"
:current="state.currentTab"
@change="onTabsChange"
>
</su-tabs> </su-tabs>
</su-sticky> </su-sticky>
@ -103,14 +95,9 @@
<view class="order-time">{{ item.create_time }}</view> <view class="order-time">{{ item.create_time }}</view>
</view> </view>
</view> </view>
<s-goods-item <s-goods-item class="border-bottom" :img="item.order_item.goods_image"
class="border-bottom" :title="item.order_item.goods_title" :skuText="item.order_item.goods_sku_text"
:img="item.order_item.goods_image" :price="item.order_item.goods_price" :num="item.order_item.goods_num">
:title="item.order_item.goods_title"
:skuText="item.order_item.goods_sku_text"
:price="item.order_item.goods_price"
:num="item.order_item.goods_num"
>
<template #rightBottom> <template #rightBottom>
<view class="ss-flex commission-box ss-row-between ss-m-t-10"> <view class="ss-flex commission-box ss-row-between ss-m-t-10">
<view class="ss-flex"> <view class="ss-flex">
@ -128,14 +115,9 @@
<s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单"> <s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单">
</s-empty> </s-empty>
<!-- 加载更多 --> <!-- 加载更多 -->
<uni-load-more <uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
contentdown: '上拉加载更多', contentdown: '上拉加载更多',
}" }" @tap="loadmore" />
@tap="loadmore"
/>
</view> </view>
<!-- </view> --> <!-- </view> -->
</s-layout> </s-layout>
@ -143,10 +125,18 @@
<script setup> <script setup>
import sheep from '@/sheep'; import sheep from '@/sheep';
import { onLoad, onReachBottom } from '@dcloudio/uni-app'; import {
import { computed, reactive } from 'vue'; onLoad,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive
} from 'vue';
import _ from 'lodash'; import _ from 'lodash';
import { onPageScroll } from '@dcloudio/uni-app'; import {
onPageScroll
} from '@dcloudio/uni-app';
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png'); const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
@ -171,8 +161,7 @@
scrollTop: false, scrollTop: false,
}); });
const tabMaps = [ const tabMaps = [{
{
name: '全部', name: '全部',
value: 'all', value: 'all',
}, },
@ -228,7 +217,11 @@
} }
async function getAgentInfo() { async function getAgentInfo() {
const { error, data, msg } = await sheep.$api.commission.agent(); const {
error,
data,
msg
} = await sheep.$api.commission.agent();
if (error === 0) { if (error === 0) {
state.agentInfo = data; state.agentInfo = data;
} }
@ -260,6 +253,7 @@
background: v-bind(headerBg) no-repeat, background: v-bind(headerBg) no-repeat,
linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient)); linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
background-size: 750rpx 100%; background-size: 750rpx 100%;
// //
.team-data-box { .team-data-box {
.data-card { .data-card {

View File

@ -1,3 +1,4 @@
<!-- 首页支持店铺装修 -->
<template> <template>
<view v-if="template"> <view v-if="template">
<s-layout title="首页" navbar="custom" tabbar="/pages/index/index" :bgStyle="template.page" <s-layout title="首页" navbar="custom" tabbar="/pages/index/index" :bgStyle="template.page"
@ -20,7 +21,6 @@
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
import sheep from '@/sheep'; import sheep from '@/sheep';
import $share from '@/sheep/platform/share'; import $share from '@/sheep/platform/share';
import index2Api from '@/sheep/api/index2';
// tabBar // tabBar
uni.hideTabBar(); uni.hideTabBar();

View File

@ -1,3 +1,4 @@
<!-- 自定义页面支持装修 -->
<template> <template>
<s-layout <s-layout
:title="page.name" :title="page.name"
@ -38,6 +39,7 @@
} }
// #endif // #endif
// TODO @
const { error, data } = await sheep.$api.app.page(id); const { error, data } = await sheep.$api.app.page(id);
if (error === 0) { if (error === 0) {
page.name = data.name; page.name = data.name;

View File

@ -1,3 +1,4 @@
<!-- 个人中心支持装修 -->
<template> <template>
<s-layout <s-layout
title="我的" title="我的"

View File

@ -85,7 +85,7 @@
// #endif // #endif
sheep.$router.go('/pages/pay/index', { sheep.$router.go('/pages/pay/index', {
id: data.payOrderId, id: data.payOrderId,
type: 'recharge' orderType: 'recharge'
}); });
} }

View File

@ -8,12 +8,11 @@
}, },
]"> ]">
<view class="header-bg"> <view class="header-bg">
<view class="bg"></view> <view class="bg" />
</view> </view>
<view class="score-box ss-flex-col ss-row-center ss-col-center"> <view class="score-box ss-flex-col ss-row-center ss-col-center">
<view class="ss-m-b-30"> <view class="ss-m-b-30">
<text class="all-title ss-m-r-8">当前积分</text> <text class="all-title ss-m-r-8">当前积分</text>
<!-- <text class="cicon-help-o"></text> -->
</view> </view>
<text class="all-num">{{ userInfo.point || 0 }}</text> <text class="all-num">{{ userInfo.point || 0 }}</text>
</view> </view>
@ -100,7 +99,6 @@
name: '全部', name: '全部',
value: 'all', value: 'all',
}, },
// { // {
// name: '', // name: '',
// value: 'income', // value: 'income',
@ -147,6 +145,7 @@
// } // }
} }
} }
onLoad(async (options) => { onLoad(async (options) => {
state.today = dayjs().format('YYYY-MM-DD'); state.today = dayjs().format('YYYY-MM-DD');
state.date = [state.today, state.today]; state.date = [state.today, state.today];
@ -166,10 +165,6 @@
getLogList(); getLogList();
} }
function appendTimeHMS(arr) {
return [arr[0] + ' 00:00:00', arr[1] + ' 23:59:59'];
}
function onLoadMore() { function onLoadMore() {
// if (state.loadStatus !== 'noMore') { // if (state.loadStatus !== 'noMore') {
getLogList(pagination.current_page + 1); getLogList(pagination.current_page + 1);

View File

@ -13,19 +13,6 @@ export default {
showLoading: false, showLoading: false,
}, },
}), }),
// 同步客户端页面到后端
pageSync: (pages) =>
request({
url: 'pageSync',
method: 'POST',
data: {
pages,
},
custom: {
showError: false,
showLoading: false,
},
}),
// 自定义页面 // 自定义页面
page: (id) => page: (id) =>
request({ request({

View File

@ -41,10 +41,11 @@ export default {
method: 'GET', method: 'GET',
params, params,
}), }),
// 分销商品 // 分销商品
goods: (params) => goods: (params) =>
request({ request({
url: 'commission/goods', url: '/app-api/product/spu/page',
method: 'GET', method: 'GET',
params, params,
}), }),
@ -62,4 +63,9 @@ export default {
method: 'POST', method: 'POST',
data, data,
}), }),
getSummary: (data) =>
request({
url: '/app-api/trade/brokerage-user/get-summary',
method: 'GET',
}),
}; };

View File

@ -37,6 +37,20 @@ const AuthUtil = {
method: 'POST', method: 'POST',
}); });
}, },
// 创建微信 JS SDK 初始化所需的签名
createWeixinMpJsapiSignature: (url) => {
return request({
url: '/app-api/member/auth/create-weixin-jsapi-signature',
method: 'POST',
params: {
url
},
custom: {
showError: false,
showLoading: false,
},
})
},
}; };
export default AuthUtil; export default AuthUtil;

View File

@ -75,18 +75,6 @@ export default {
}, },
}), }),
// 网页jssdk
jssdk: (data) =>
request({
url: 'third/wechat/jssdk',
method: 'GET',
data,
custom: {
showError: false,
showLoading: false,
},
}),
// 小程序订阅消息 // 小程序订阅消息
subscribeTemplate: (params) => subscribeTemplate: (params) =>
request({ request({

View File

@ -51,7 +51,7 @@
<image <image
class="auto-login-img" class="auto-login-img"
:src="sheep.$url.static('/static/img/shop/platform/wechat.png')" :src="sheep.$url.static('/static/img/shop/platform/wechat.png')"
></image> />
</button> </button>
<!-- iOS登录 --> <!-- iOS登录 -->

View File

@ -1,3 +1,4 @@
<!-- 装修组件容器 -->
<template> <template>
<view :style="[elStyles, elBackground]"><slot /></view> <view :style="[elStyles, elBackground]"><slot /></view>
</template> </template>

View File

@ -1,4 +1,4 @@
<!-- 优惠券 --> <!-- 装修营销组件优惠券 -->
<template> <template>
<scroll-view class="scroll-box" scroll-x scroll-anchoring> <scroll-view class="scroll-box" scroll-x scroll-anchoring>
<view class="coupon-box ss-flex"> <view class="coupon-box ss-flex">

View File

@ -1,3 +1,4 @@
<!-- 装修用户组件用户卡券 -->
<template> <template>
<view class="ss-coupon-menu-wrap ss-flex ss-col-center"> <view class="ss-coupon-menu-wrap ss-flex ss-col-center">
<view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title" <view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title"
@ -41,13 +42,13 @@
path: '/pages/coupon/list', path: '/pages/coupon/list',
type: 'expired', type: 'expired',
}, },
// { {
// title: '', title: '领券中心',
// value: '0', value: '0',
// icon: '/static/img/shop/order/all_coupon.png', icon: '/static/img/shop/order/all_coupon.png',
// path: '/pages/coupon/list', path: '/pages/coupon/list',
// type: 'all', type: 'all',
// }, },
]; ];
}, },
}, },

View File

@ -1,3 +1,4 @@
<!-- 顶部导航栏 -->
<template> <template>
<navbar <navbar
:alway="isAlway" :alway="isAlway"

View File

@ -1,3 +1,4 @@
<!-- 装修基础组件悬浮按钮 -->
<template> <template>
<!-- 模态背景展开时显示点击后折叠 --> <!-- 模态背景展开时显示点击后折叠 -->
<view class="modal-bg" v-if="fabRef?.isShow" @click="handleCollapseFab"></view> <view class="modal-bg" v-if="fabRef?.isShow" @click="handleCollapseFab"></view>

View File

@ -1,3 +1,4 @@
<!-- 装修商品组件商品卡片 -->
<template> <template>
<!-- 商品卡片 --> <!-- 商品卡片 -->
<view> <view>

View File

@ -1,3 +1,4 @@
<!-- 装修商品组件商品栏 -->
<template> <template>
<view> <view>
<!-- 布局1. 两列商品图片左文案右 --> <!-- 布局1. 两列商品图片左文案右 -->
@ -27,7 +28,7 @@
:bottomRadius="data.borderRadiusBottom" :bottomRadius="data.borderRadiusBottom"
:titleWidth="(454 - marginRight * 2 - data.space * 2 - marginLeft * 2) / 2" :titleWidth="(454 - marginRight * 2 - data.space * 2 - marginLeft * 2) / 2"
@click="sheep.$router.go('/pages/goods/index', { id: item.id })" @click="sheep.$router.go('/pages/goods/index', { id: item.id })"
></s-goods-column> />
</view> </view>
</view> </view>
<!-- 布局. 三列商品图片上文案下 --> <!-- 布局. 三列商品图片上文案下 -->
@ -56,7 +57,7 @@
:topRadius="data.borderRadiusTop" :topRadius="data.borderRadiusTop"
:bottomRadius="data.borderRadiusBottom" :bottomRadius="data.borderRadiusBottom"
@click="sheep.$router.go('/pages/goods/index', { id: item.id })" @click="sheep.$router.go('/pages/goods/index', { id: item.id })"
></s-goods-column> />
</view> </view>
</view> </view>
@ -79,7 +80,7 @@
:titleColor="data.fields.name?.color" :titleColor="data.fields.name?.color"
:titleWidth="(750 - marginRight * 2 - data.space * 4 - marginLeft * 2) / 3" :titleWidth="(750 - marginRight * 2 - data.space * 4 - marginLeft * 2) / 3"
@click="sheep.$router.go('/pages/goods/index', { id: item.id })" @click="sheep.$router.go('/pages/goods/index', { id: item.id })"
></s-goods-column> />
</view> </view>
</view> </view>
</scroll-view> </scroll-view>

View File

@ -1,3 +1,4 @@
<!-- 装修图文组件热区 -->
<template> <template>
<view class="hotzone-wrap"> <view class="hotzone-wrap">
<image :src="sheep.$url.cdn(data.imgUrl)" style="width: 100%" mode="widthFix"></image> <image :src="sheep.$url.cdn(data.imgUrl)" style="width: 100%" mode="widthFix"></image>

View File

@ -1,3 +1,4 @@
<!-- 装修图文组件图片轮播 -->
<template> <template>
<su-swiper <su-swiper
:list="imgList" :list="imgList"

View File

@ -1,6 +1,7 @@
<!-- 装修图文组件图片展示 -->
<template> <template>
<view @tap="sheep.$router.go(data?.url)"> <view @tap="sheep.$router.go(data?.url)">
<su-image :src="sheep.$url.cdn(data.imgUrl)" mode="widthFix"></su-image> <su-image :src="sheep.$url.cdn(data.imgUrl)" mode="widthFix" />
</view> </view>
</template> </template>

View File

@ -1,3 +1,4 @@
<!-- 装修图文组件广告魔方 -->
<template> <template>
<view class="ss-cube-wrap" :style="[parseAdWrap]"> <view class="ss-cube-wrap" :style="[parseAdWrap]">
<view v-for="(item, index) in data.list" :key="index"> <view v-for="(item, index) in data.list" :key="index">

View File

@ -1,3 +1,4 @@
<!-- 装修基础组件分割线 -->
<template> <template>
<su-subline v-bind="data"></su-subline> <su-subline v-bind="data"></su-subline>
</template> </template>

View File

@ -1,3 +1,4 @@
<!-- 装修基础组件菜单导航金刚区 -->
<template> <template>
<!-- 包裹层 --> <!-- 包裹层 -->
<view <view

View File

@ -1,3 +1,4 @@
<!-- 装修基础组件宫格导航 -->
<template> <template>
<uni-grid :showBorder="Boolean(data.border)" :column="data.column"> <uni-grid :showBorder="Boolean(data.border)" :column="data.column">
<uni-grid-item <uni-grid-item

View File

@ -1,3 +1,4 @@
<!-- 装修基础组件列表导航 -->
<template> <template>
<view class="menu-list-wrap"> <view class="menu-list-wrap">
<uni-list :border="true"> <uni-list :border="true">

View File

@ -11,7 +11,7 @@
:speed="50" :speed="50"
:color="data.textColor" :color="data.textColor"
@tap="sheep.$router.go(data.contents[0].url)" @tap="sheep.$router.go(data.contents[0].url)"
></su-notice-bar> />
</view> </view>
</template> </template>

View File

@ -1,3 +1,4 @@
<!-- 装修用户组件用户订单 -->
<template> <template>
<view class="ss-order-menu-wrap ss-flex ss-col-center"> <view class="ss-order-menu-wrap ss-flex ss-col-center">
<view <view

View File

@ -1,3 +1,4 @@
<!-- 装修营销组件营销文章 -->
<template> <template>
<view <view
:style="[ :style="[
@ -16,6 +17,7 @@
<script setup> <script setup>
import { reactive, onMounted } from 'vue'; import { reactive, onMounted } from 'vue';
import ArticleApi from '@/sheep/api/promotion/article'; import ArticleApi from '@/sheep/api/promotion/article';
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
@ -26,9 +28,11 @@
default() {}, default() {},
}, },
}); });
const state = reactive({ const state = reactive({
content: '', content: '',
}); });
onMounted(async () => { onMounted(async () => {
const { data } = await ArticleApi.getArticle(props.data.id); const { data } = await ArticleApi.getArticle(props.data.id);
state.content = data.content; state.content = data.content;

View File

@ -1,4 +1,4 @@
<!-- 页面 --> <!-- 装修商品组件标题栏 -->
<template> <template>
<view <view
class="ss-title-wrap ss-flex ss-col-center" class="ss-title-wrap ss-flex ss-col-center"

View File

@ -1,4 +1,4 @@
<!-- 页面 --> <!-- 装修用户组件用户卡片 -->
<template> <template>
<view class="ss-user-info-wrap ss-p-t-50"> <view class="ss-user-info-wrap ss-p-t-50">
<view class="ss-flex ss-col-center ss-row-between ss-m-b-20"> <view class="ss-flex ss-col-center ss-row-between ss-m-b-20">
@ -23,7 +23,7 @@
</view> </view>
</view> </view>
<!-- TODO @芋艿用户接入 -->
<!-- 提示绑定手机号 先隐藏 yudao 需要再修改 --> <!-- 提示绑定手机号 先隐藏 yudao 需要再修改 -->
<!-- <view <!-- <view
class="bind-mobile-box ss-flex ss-row-between ss-col-center" class="bind-mobile-box ss-flex ss-row-between ss-col-center"

View File

@ -1,4 +1,4 @@
<!-- --> <!-- 装修图文组件视频播放 -->
<template> <template>
<su-video <su-video
class="sss" class="sss"

View File

@ -1,3 +1,4 @@
<!-- 装修用户组件用户资产 -->
<template> <template>
<!-- TODO @惠智造代码合并有问题可以看看 --> <!-- TODO @惠智造代码合并有问题可以看看 -->
<view class="ss-wallet-menu-wrap ss-flex ss-col-center"> <view class="ss-wallet-menu-wrap ss-flex ss-col-center">

View File

@ -46,8 +46,9 @@ function ShoproDebug() {
// }); // });
// #endif // #endif
// TODO 芋艿:可以打印路由
// 同步前端页面到后端 // 同步前端页面到后端
$api.app.pageSync(ROUTES); // console.log(ROUTES)
} }
export default sheep; export default sheep;

View File

@ -3,9 +3,10 @@
* 更多微信网页开发sdk方法,详见:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html * 更多微信网页开发sdk方法,详见:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html
*/ */
import jweixin from 'weixin-js-sdk'; import jweixin, { ready } from 'weixin-js-sdk';
import $helper from '@/sheep/helper'; import $helper from '@/sheep/helper';
import third from '@/sheep/api/third'; import third from '@/sheep/api/third';
import AuthUtil from '@/sheep/api/member/auth';
let configSuccess = false; let configSuccess = false;
@ -13,11 +14,8 @@ export default {
// 判断是否在微信中 // 判断是否在微信中
isWechat() { isWechat() {
const ua = window.navigator.userAgent.toLowerCase(); const ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/micromessenger/i) == 'micromessenger') { // noinspection EqualityComparisonWithCoercionJS
return true; return ua.match(/micromessenger/i) == 'micromessenger';
} else {
return false;
}
}, },
isReady(api) { isReady(api) {
@ -31,42 +29,41 @@ export default {
return; return;
} }
// 调用后端接口,获得 JSSDK 初始化所需的签名
const url = location.href.split('#')[0]; const url = location.href.split('#')[0];
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(url);
const { error, data } = await third.wechat.jssdk({ if (code === 0) {
platform: 'officialAccount',
payload: encodeURIComponent(
JSON.stringify({
url,
}),
),
});
if (error === 0) {
jweixin.config({ jweixin.config({
debug: false, debug: false,
appId: data.appId, appId: data.appId,
timestamp: data.timestamp, timestamp: data.timestamp,
nonceStr: data.nonceStr, nonceStr: data.nonceStr,
signature: data.signature, signature: data.signature,
jsApiList: data.jsApiList, jsApiList: ['chooseWXPay'], // TODO 芋艿:后续可以设置更多权限;
openTagList: data.openTagList, openTagList: data.openTagList
}); });
} }
// 监听结果
configSuccess = true; configSuccess = true;
jweixin.error((err) => { jweixin.error((err) => {
configSuccess = false; configSuccess = false;
console.error('微信 JSSDK 初始化失败', err);
// $helper.toast('微信JSSDK:' + err.errMsg); // $helper.toast('微信JSSDK:' + err.errMsg);
}); });
jweixin.ready(() => {
if (configSuccess) {
console.log('微信 JSSDK 初始化成功');
}
})
// 回调
if (callback) { if (callback) {
callback(data); callback(data);
} }
}, },
//在需要定位页面调用 //在需要定位页面调用 TODO 芋艿:未测试
getLocation(callback) { getLocation(callback) {
this.isReady(() => { this.isReady(() => {
jweixin.getLocation({ jweixin.getLocation({
@ -81,7 +78,7 @@ export default {
}); });
}, },
//获取微信收货地址 //获取微信收货地址 TODO 芋艿:未测试
openAddress(callback) { openAddress(callback) {
this.isReady(() => { this.isReady(() => {
jweixin.openAddress({ jweixin.openAddress({
@ -97,7 +94,7 @@ export default {
}); });
}, },
// 微信扫码 // 微信扫码 TODO 芋艿:未测试
scanQRCode(callback) { scanQRCode(callback) {
this.isReady(() => { this.isReady(() => {
jweixin.scanQRCode({ jweixin.scanQRCode({
@ -113,7 +110,7 @@ export default {
}); });
}, },
// 更新微信分享信息 // 更新微信分享信息 TODO 芋艿:未测试
updateShareInfo(data, callback = null) { updateShareInfo(data, callback = null) {
this.isReady(() => { this.isReady(() => {
const shareData = { const shareData = {
@ -137,7 +134,7 @@ export default {
}); });
}, },
// 打开坐标位置 // 打开坐标位置 TODO 芋艿:未测试
openLocation(data, callback) { openLocation(data, callback) {
this.isReady(() => { this.isReady(() => {
jweixin.openLocation({ jweixin.openLocation({
@ -148,7 +145,7 @@ export default {
}); });
}, },
// 选择图片 // 选择图片 TODO 芋艿:未测试
chooseImage(callback) { chooseImage(callback) {
this.isReady(() => { this.isReady(() => {
jweixin.chooseImage({ jweixin.chooseImage({
@ -162,7 +159,7 @@ export default {
}); });
}, },
//微信支付 //微信支付 TODO 芋艿:未测试
wxpay(data, callback) { wxpay(data, callback) {
this.isReady(() => { this.isReady(() => {
jweixin.chooseWXPay({ jweixin.chooseWXPay({

View File

@ -8,7 +8,7 @@ import PayOrderApi from '@/sheep/api/pay/order';
/** /**
* 支付 * 支付
* *
* @param {String} payment = ['wechat','alipay','wallet','offline'] - 支付方式 * @param {String} payment = ['wechat','alipay','wallet','mock'] - 支付方式
* @param {String} orderType = ['goods','recharge','groupon'] - 订单类型 * @param {String} orderType = ['goods','recharge','groupon'] - 订单类型
* @param {String} id - 订单号 * @param {String} id - 订单号
*/ */
@ -33,8 +33,8 @@ export default class SheepPay {
wallet: () => { wallet: () => {
this.walletPay(); this.walletPay();
}, },
offline: () => { mock: () => {
this.offlinePay(); this.mockPay();
} }
}, },
WechatMiniProgram: { WechatMiniProgram: {
@ -47,8 +47,8 @@ export default class SheepPay {
wallet: () => { wallet: () => {
this.walletPay(); this.walletPay();
}, },
offline: () => { mock: () => {
this.offlinePay(); this.mockPay();
} }
}, },
App: { App: {
@ -61,8 +61,8 @@ export default class SheepPay {
wallet: () => { wallet: () => {
this.walletPay(); this.walletPay();
}, },
offline: () => { mock: () => {
this.offlinePay(); this.mockPay();
} }
}, },
H5: { H5: {
@ -75,8 +75,8 @@ export default class SheepPay {
wallet: () => { wallet: () => {
this.walletPay(); this.walletPay();
}, },
offline: () => { mock: () => {
this.offlinePay(); this.mockPay();
} }
}, },
}; };
@ -182,10 +182,10 @@ export default class SheepPay {
code === 0 && this.payResult('success'); code === 0 && this.payResult('success');
} }
// 货到付款 TODO 芋艿:待接入 // 模拟支付
async offlinePay() { async mockPay() {
const { error } = await this.prepay(); const { code } = await this.prepay('mock');
error === 0 && this.payResult('success'); code === 0 && this.payResult('success');
} }
// 支付宝复制链接支付 TODO 芋艿:待接入 // 支付宝复制链接支付 TODO 芋艿:待接入

View File

@ -20,6 +20,7 @@ async function load() {
// 微信公众号登陆 // 微信公众号登陆
async function login(code = '') { async function login(code = '') {
// 获取登陆地址 // 获取登陆地址
debugger
if (!code) { if (!code) {
const loginResult = await getLoginUrl(); const loginResult = await getLoginUrl();
if (loginResult.error === 0 && loginResult.data.login_url) { if (loginResult.error === 0 && loginResult.data.login_url) {
@ -38,6 +39,7 @@ async function login(code = '') {
// 微信公众号绑定 // 微信公众号绑定
async function bind(code = '') { async function bind(code = '') {
debugger
// 获取绑定地址 // 获取绑定地址
if (code === '') { if (code === '') {
const loginResult = await getLoginUrl('bind'); const loginResult = await getLoginUrl('bind');
@ -57,6 +59,7 @@ async function bind(code = '') {
// 微信公众号解除绑定 // 微信公众号解除绑定
async function unbind() { async function unbind() {
debugger
const { error } = await third.wechat.unbind({ const { error } = await third.wechat.unbind({
platform: 'officialAccount', platform: 'officialAccount',
}); });
@ -65,6 +68,7 @@ async function unbind() {
// 获取公众号登陆地址 // 获取公众号登陆地址
function getLoginUrl(event = 'login') { function getLoginUrl(event = 'login') {
debugger
let page = getRootUrl() + 'pages/index/login'; let page = getRootUrl() + 'pages/index/login';
return third.wechat.oauthLogin({ return third.wechat.oauthLogin({
@ -80,6 +84,7 @@ function getLoginUrl(event = 'login') {
// 此处使用前端发送code在后端解密防止用户在后端过长时间停留 // 此处使用前端发送code在后端解密防止用户在后端过长时间停留
function loginByCode(code) { function loginByCode(code) {
debugger
return third.wechat.login({ return third.wechat.login({
platform: 'officialAccount', platform: 'officialAccount',
shareInfo: uni.getStorageSync('shareLog') || {}, shareInfo: uni.getStorageSync('shareLog') || {},
@ -93,6 +98,7 @@ function loginByCode(code) {
// 此处使用前端发送code在后端解密防止用户在后端过长时间停留 // 此处使用前端发送code在后端解密防止用户在后端过长时间停留
function bindByCode(code) { function bindByCode(code) {
debugger
return third.wechat.bind({ return third.wechat.bind({
platform: 'officialAccount', platform: 'officialAccount',
payload: encodeURIComponent( payload: encodeURIComponent(

View File

@ -1,5 +1,4 @@
// 登录 // 登录
import { isEmpty } from 'lodash';
import third from '@/sheep/api/third'; import third from '@/sheep/api/third';
const load = async () => {}; const load = async () => {};
@ -11,6 +10,7 @@ const login = () => {
provider: 'weixin', provider: 'weixin',
onlyAuthorize: true, onlyAuthorize: true,
}); });
debugger
if (loginRes.errMsg == 'login:ok') { if (loginRes.errMsg == 'login:ok') {
const res = await third.wechat.login({ const res = await third.wechat.login({
platform: 'openPlatform', platform: 'openPlatform',

View File

@ -61,18 +61,21 @@ const app = defineStore({
$router.error('NetworkError'); $router.error('NetworkError');
} }
// 加载装修配置
await adaptTemplate(this.template, templateId) await adaptTemplate(this.template, templateId)
const res = await appApi.init(templateId); const res = await appApi.init(templateId);
if (res.error === 0) { if (res.error === 0) {
this.info = res.data.app; this.info = res.data.app;
this.platform = res.data.platform; this.platform = res.data.platform;
// TODO 芋艿:未接入
// this.template = res.data.template; // this.template = res.data.template;
this.has_wechat_trade_managed = res.data.has_wechat_trade_managed; // this.has_wechat_trade_managed = res.data.has_wechat_trade_managed;
// if (!res.data.template) { // if (!res.data.template) {
// $router.error('TemplateError'); // $router.error('TemplateError');
// } // }
this.chat = res.data.chat; // TODO 芋艿:未接入
// this.chat = res.data.chat;
// 加载主题 // 加载主题
const sysStore = sys(); const sysStore = sys();

View File

@ -1,3 +1,4 @@
<!-- 自定义导航栏 -->
<template> <template>
<view class="uni-navbar" :class="{ 'uni-dark': dark }"> <view class="uni-navbar" :class="{ 'uni-dark': dark }">
<view <view

View File

@ -1,3 +1,4 @@
<!-- 公告栏组件 -->
<template> <template>
<view <view
v-if="show" v-if="show"

View File

@ -1,10 +1,10 @@
<!-- 自定义状态栏 -->
<template> <template>
<view :style="{ height: statusBarHeight }" class="uni-status-bar"><slot /></view> <view :style="{ height: statusBarHeight }" class="uni-status-bar"><slot /></view>
</template> </template>
<script setup> <script setup>
import sheep from '@/sheep'; import sheep from '@/sheep';
import { computed } from 'vue';
const statusBarHeight = sheep.$platform.device.statusBarHeight + 'px'; const statusBarHeight = sheep.$platform.device.statusBarHeight + 'px';
</script> </script>

View File

@ -1,3 +1,4 @@
<!-- 自定义底部导航项 -->
<template> <template>
<view class="u-tabbar-item" :style="[addStyle(customStyle)]"> <view class="u-tabbar-item" :style="[addStyle(customStyle)]">
<view v-if="isCenter" class="tabbar-center-item"> <view v-if="isCenter" class="tabbar-center-item">

View File

@ -1,3 +1,4 @@
<!-- 底部导航栏 -->
<template> <template>
<view class="u-tabbar"> <view class="u-tabbar">
<view <view