update uni-app

This commit is contained in:
全栈小学生 2023-09-06 18:44:12 +08:00
parent 94c19e2ee3
commit 2ebaa66ec3
183 changed files with 24032 additions and 3784 deletions

3
uni-app/.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}

View File

@ -6,20 +6,14 @@ VITE_APP_BASE_URL=''
# 图片服务器地址 # 图片服务器地址
VITE_IMG_DOMAIN='' VITE_IMG_DOMAIN=''
# 本地开发时站点id
VITE_SITE_ID = ''
# 本地存储时token的参数名 # 本地存储时token的参数名
VITE_REQUEST_STORAGE_TOKEN_KEY='wapToken' VITE_REQUEST_STORAGE_TOKEN_KEY='wapToken'
# 请求时header中token的参数名 # 请求时header中token的参数名
VITE_REQUEST_HEADER_TOKEN_KEY='token' VITE_REQUEST_HEADER_TOKEN_KEY='token'
# 请求时header中站点的参数名
VITE_REQUEST_HEADER_SITEID_KEY='site-id'
# 请求时header中来源场景的参数名 # 请求时header中来源场景的参数名
VITE_REQUEST_HEADER_CHANNEL_KEY='channel' VITE_REQUEST_HEADER_CHANNEL_KEY='channel'
# 应用版本 # 应用版本
VITE_APP_VERSION='1.0.1' VITE_APP_VERSION='1.0.1'

View File

@ -6,18 +6,12 @@ VITE_APP_BASE_URL=''
# 图片服务器地址 # 图片服务器地址
VITE_IMG_DOMAIN='' VITE_IMG_DOMAIN=''
# 站点id 仅在编译为小程序时生效
VITE_SITE_ID = ''
# 本地存储时token的参数名 # 本地存储时token的参数名
VITE_REQUEST_STORAGE_TOKEN_KEY='wapToken' VITE_REQUEST_STORAGE_TOKEN_KEY='wapToken'
# 请求时header中token的参数名 # 请求时header中token的参数名
VITE_REQUEST_HEADER_TOKEN_KEY='token' VITE_REQUEST_HEADER_TOKEN_KEY='token'
# 请求时header中站点的参数名
VITE_REQUEST_HEADER_SITEID_KEY='site-id'
# 请求时header中来源场景的参数名 # 请求时header中来源场景的参数名
VITE_REQUEST_HEADER_CHANNEL_KEY='channel' VITE_REQUEST_HEADER_CHANNEL_KEY='channel'

25
uni-app/.gitignore vendored
View File

@ -1,4 +1,21 @@
/node_modules # Logs
/.vite logs
/.hbuilderx *.log
/unpackage npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
*.local
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -1,29 +0,0 @@
import request from '@/utils/request'
/**
*
*/
export function getArticleList(params: Record<string, any>) {
return request.get('article/article', params)
}
/**
*
*/
export function getArticleAll(params: Record<string, any>) {
return request.get('article/article/all', params)
}
/**
*
*/
export function getArticleDetail(id: number) {
return request.get(`article/article/${id}`)
}
/**
*
*/
export function getArticleCategory() {
return request.get('article/category')
}

View File

@ -1,22 +0,0 @@
import request from '@/utils/request'
/**
*
*/
export function getDiyInfo(params : Record<string, any>) {
return request.get('diy/diy', params)
}
/**
*
*/
export function getTabbarInfo() {
return request.get('diy/tabbar')
}
/**
*
*/
export function getShareInfo(params : Record<string, any>) {
return request.get('diy/share', params)
}

View File

@ -1,145 +0,0 @@
import request from '@/utils/request'
export function getMemberInfo() {
return request.get('member/member')
}
/**
*
*/
export function getPointList(data : AnyObject) {
return request.get('member/account/point', data)
}
/**
*
*/
export function getBalanceList(data : AnyObject) {
return request.get('member/account/balance', data)
}
/**
*
*/
export function getMoneyList(data : AnyObject) {
return request.get('member/account/money', data)
}
/**
*
*/
export function modifyMember(data : AnyObject) {
return request.put(`member/modify/${data.field}`, data, { showErrorMessage: true })
}
/**
*
*/
export function createRecharge(data : AnyObject) {
return request.post('order/recharge', data, { showErrorMessage: true })
}
/**
*
*/
export function getRechargeList(data : AnyObject) {
return request.get('order/recharge', data, { showErrorMessage: true })
}
/**
*
*/
export function getRechargeDetail(id:number) {
return request.get(`order/recharge/${id}`, {}, { showErrorMessage: true })
}
/**
*
*/
export function bindMobile(data : AnyObject) {
return request.put('member/mobile', data, { showErrorMessage: true })
}
/**
*
*/
export function cashOutTransferType() {
return request.get('member/cash_out/transfertype')
}
/**
*
*/
export function cashOutConfig() {
return request.get('member/cash_out/config')
}
/**
*
*/
export function cashOutApply(data : AnyObject) {
return request.post('member/cash_out/apply', data, { showSuccessMessage: true, showErrorMessage: true })
}
/**
*
*/
export function getCashoutAccountInfo(data : AnyObject) {
return request.get(`member/cashout_account/${data.account_id}`, {})
}
/**
*
*/
export function getFirstCashoutAccountInfo(data : AnyObject) {
return request.get('member/cashout_account/firstinfo', data)
}
/**
*
*/
export function getCashoutAccountList(data : AnyObject) {
return request.get(`member/cashout_account`, data)
}
/**
*
*/
export function getCashOutList(data : AnyObject) {
return request.get(`member/cash_out`, data)
}
/**
*
*/
export function getCashOutDetail(id : number) {
return request.get(`member/cash_out/${id}`)
}
/**
*
*/
export function addCashoutAccount(data : AnyObject) {
return request.post('member/cashout_account', data, { showSuccessMessage: true, showErrorMessage: true })
}
/**
*
*/
export function editCashoutAccount(data : AnyObject) {
return request.put(`member/cashout_account/${data.account_id}`, data, { showSuccessMessage: true, showErrorMessage: true })
}
/**
*
*/
export function deleteCashoutAccount(accountId: number) {
return request.delete(`member/cashout_account/${accountId}`, { showSuccessMessage: true, showErrorMessage: true })
}
/**
*
*/
export function getCommissionList(data : AnyObject) {
return request.get(`member/account/commission`, data)
}

View File

@ -1,15 +0,0 @@
import request from '@/utils/request'
/**
*
*/
export function pay(data : AnyObject) {
return request.post(`pay`, data, { showErrorMessage: true })
}
/**
*
*/
export function getPayInfo(tradeType : string, tradeId : number) {
return request.get(`pay/info/${tradeType}/${tradeId}`, {}, { showErrorMessage: true })
}

View File

@ -1,132 +0,0 @@
<template>
<view :style="warpCss">
<view v-for="(item,index) in articleList" :key="item.id"
:class="['item flex align-center p-[20rpx]',{'border-solid border-t-0 border-l-0 border-r-0 border-b border-gray-200 mb-[20rpx]': articleList.length-1 !== index}] "
@click="toLink(item.id)" :style="itemCss">
<u--image width="260rpx" height="200rpx" :src="img(item.image)" v-if="item.image" model="aspectFill">
<template #error>
<u-icon name="photo" color="#999" size="50"></u-icon>
</template>
</u--image>
<view class="flex-1 flex flex-col justify-between ml-[20rpx]">
<view class="text-[32rpx] leading-[1.3] multi-hidden mt-[4rpx]">{{item.title}}</view>
<view class="text-[28rpx] using-hidden mb-[auto] mt-[20rpx] text-gray-500">{{item.summary}}</view>
<view class="text-[24rpx] text-gray-400 flex justify-between mt-[10rpx]">
<text>{{item.create_time}}</text>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
//
import { ref, computed, watch } from 'vue';
import { redirect, img } from '@/utils/common';
import useDiyStore from '@/stores/diy';
import { getArticleAll } from '@/api/article';
const props = defineProps(['component', 'index', 'pullDownRefresh']);
const diyStore = useDiyStore();
const articleList = ref<Array<any>>([]);
const diyComponent = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore.value[props.index];
} else {
return props.component;
}
})
const warpCss = computed(() => {
var style = '';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
if (diyComponent.value.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
return style;
})
const itemCss = computed(() => {
var style = '';
if (diyComponent.value.elementBgColor) style += 'background-color:' + diyComponent.value.elementBgColor + ';';
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
if (diyComponent.value.topElementRounded) style += 'border-top-right-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
if (diyComponent.value.bottomElementRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomElementRounded * 2 + 'rpx;';
if (diyComponent.value.bottomElementRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomElementRounded * 2 + 'rpx;';
return style;
})
watch(
() => props.pullDownRefresh,
(newValue, oldValue) => {
//
}
)
const getArticleListFn = () => {
interface dataStructure {
ids ?: Array<number>,
limit ?: number
}
let data : dataStructure = {};
if (diyComponent.value.sources == "diy")
data.ids = diyComponent.value.articleIds;
else
data.limit = diyComponent.value.count;
interface takeDataStructure {
data : Array<Object>,
msg : string,
code : number
}
getArticleAll(data).then((res : takeDataStructure) => {
articleList.value = res.data;
});
}
const refresh = () => {
if (diyStore.mode == 'decorate') {
let obj = {
image: "",
summary: "文章摘要",
title: "文章标题",
create_time: "2023-03-28 09:00:00"
};
articleList.value.push(obj);
articleList.value.push(obj);
} else {
getArticleListFn();
}
}
refresh();
const toLink = (id : string) => {
redirect({ url: '/pages/article/detail', param: { id } })
}
</script>
<style lang="scss" scoped>
/* 单行超出隐藏 */
.using-hidden {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
white-space: break-spaces;
}
/* 多行超出隐藏 */
.multi-hidden {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>

View File

@ -1,91 +0,0 @@
<template>
<view class="diy-group" id="componentList">
<view v-for="(component, index) in data.value" :key="component.id"
@click="diyStore.changeCurrentIndex(index, component)" class="draggable-element relative cursor-move"
:class="{ selected: diyStore.currentIndex == index,decorate : diyStore.mode == 'decorate' }"
:style="component.pageStyle">
<template v-if="component.componentName == 'Article'">
<diy-article :component="component" :index="index"
:pullDownRefresh="props.pullDownRefresh"></diy-article>
</template>
<template v-if="component.componentName == 'GraphicNav'">
<diy-graphic-nav :component="component" :index="index"
:pullDownRefresh="props.pullDownRefresh"></diy-graphic-nav>
</template>
<template v-if="component.componentName == 'HorzBlank'">
<diy-horz-blank :component="component" :index="index"
:pullDownRefresh="props.pullDownRefresh"></diy-horz-blank>
</template>
<template v-if="component.componentName == 'ImageAds'">
<diy-image-ads :component="component" :index="index"
:pullDownRefresh="props.pullDownRefresh"></diy-image-ads>
</template>
<template v-if="component.componentName == 'MemberInfo'">
<diy-member-info :component="component" :index="index"
:pullDownRefresh="props.pullDownRefresh"></diy-member-info>
</template>
<template v-if="component.componentName == 'Text'">
<diy-text :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-text>
</template>
<template v-if="component.componentName == 'RubikCube'">
<diy-rubik-cube :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-rubik-cube>
</template>
<template v-if="component.componentName == 'HotArea'">
<diy-hot-area :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-hot-area>
</template>
</view>
<template v-if="diyStore.mode != 'decorate' && data.global.bottomTabBarSwitch">
<view class="pt-[20rpx]"></view>
<tabbar />
</template>
</view>
</template>
<script lang="ts" setup>
import useDiyStore from '@/stores/diy';
import { onMounted, nextTick, computed, ref, watch } from 'vue';
import Sortable from 'sortablejs';
import { range } from 'lodash-es';
const props = defineProps(['data', 'pullDownRefresh']);
const diyStore = useDiyStore();
const data = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore;
} else {
return props.data;
}
})
onMounted(() => {
// #ifdef H5
if (diyStore.mode == 'decorate') {
var el = document.getElementById('componentList');
const sortable = Sortable.create(el, {
group: 'draggable-element',
animation: 200,
//
onEnd: event => {
let temp = diyStore.value[event.oldIndex!];
diyStore.value.splice(event.oldIndex!, 1);
diyStore.value.splice(event.newIndex!, 0, temp);
nextTick(() => {
sortable.sort(
range(diyStore.value.length).map(value => {
return value.toString();
})
);
diyStore.postMessage(event.newIndex, diyStore.value[event.newIndex]);
});
}
});
}
// #endif
});
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>

View File

@ -1,13 +0,0 @@
<template>
<view class="fixed-group">
<template v-if="props.data.global.component == 'demo-index'">
<fixed-demo-index :data="props.data" :pullDownRefresh="props.pullDownRefresh"></fixed-demo-index>
</template>
</view>
</template>
<script lang="ts" setup>
const props = defineProps(['data', 'pullDownRefresh']);
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>

View File

@ -15,7 +15,7 @@
</head> </head>
<body> <body>
<div id="app"><!--app-html--></div> <div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script> <script type="module" src="/src/main.js"></script>
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script> <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
</body> </body>
</html> </html>

View File

@ -1,3 +0,0 @@
{
"index": "Index"
}

View File

@ -1,31 +0,0 @@
{
// pages.json
"pages.index.index": "",
"pages.index.close": "站点已关闭",
"pages.index.nosite": "站点不存在",
"pages.index.develop": "开发环境配置",
"pages.index.diy": "",
"pages.article.list": "资讯中心",
"pages.article.detail": "文章详情",
"pages.auth.agreement": "协议",
"pages.auth.bind": "绑定手机号",
"pages.auth.login": "登录",
"pages.auth.register": "注册",
"pages.auth.resetpwd": "找回密码",
"pages.member.account": "会员账户",
"pages.member.account_edit": "编辑会员账户",
"pages.member.apply_cash_out": "申请提现",
"pages.member.balance": "我的余额",
"pages.member.cash_out": "提现记录",
"pages.member.cash_out_detail": "提现详情",
"pages.member.commission": "我的佣金",
"pages.member.detailed_account": "流水明细",
"pages.member.index": "",
"pages.member.personal": "个人资料",
"pages.member.recharge_record": "充值记录",
"pages.member.recharge_record_detail": "充值详情",
"pages.pay.browser": "支付",
"pages.pay.result": "支付结果",
"pages.setting.index": "设置",
"pages.webview.index": ""
}

View File

@ -1,49 +0,0 @@
{
"requestFail": "请求失败",
"notInDomainList": "不在request 合法域名列表中",
"currency": "¥",
"getSmsCode": "获取验证码",
"smsCodeChangeText": "秒后重新获取",
"captchaTitle": "请完成验证",
"confirm": "确认",
"cancel": "取消",
"save": "保存",
"delete": "删除",
"captchaPlaceholder": "请输入验证码",
"mobilePlaceholder": "请输入手机号码",
"mobileError": "请输入正确的手机号",
"codePlaceholder": "请输入手机验证码",
"memberCenter": "个人中心",
"userAgreement": "用户协议",
"privacyAgreement": "隐私协议",
"nickname": "昵称",
"nicknamePlaceholder": "请输入昵称",
"headimg": "头像",
"headimgPlaceholder": "请设置头像",
"getAvatarNickname": "获取您的昵称头像",
"getAvatarNicknameTips": "获取用户头像、昵称完善个人资料,主要用于向用户提供具有辨识度的用户中心界面",
"point": "积分",
"balance": "余额",
"login": "登录",
"register": "注册",
"complete": "完成",
"close": "关闭",
"pay": {
"orderInfo": "订单信息",
"confirmPay": "确认支付",
"payTitle": "确认付款",
"notHavePayType": "没有可用的支付方式",
"notObtainedInfo": "未获取到支付信息",
"paymentDocuments": "该支付单据",
"paySuccess": "支付成功",
"payFail": "支付失败",
"completePay": "已完成支付",
"incompletePay": "未完成支付",
"getting": "获取支付结果中"
},
"myBalance": "我的余额",
"myPoint": "我的积分",
"customerService": "联系客服",
"siteClose": "站点已关闭",
"noSite": "站点不存在"
}

View File

@ -1,5 +0,0 @@
{
"detail": "文章详情",
"abstract": "摘要",
"loadingText": "正在加载"
}

View File

@ -1,7 +0,0 @@
{
"list": "文章列表",
"noData": "~ 暂无数据 ~",
"all": "全部",
"end": "-- 到底了 --",
"searchPlaceholder": "请输入搜索关键词"
}

View File

@ -1,21 +0,0 @@
import App from './App'
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
import locale from './locale'
import uviewPlus from 'uview-plus'
import '@/styles/index.scss'
import 'virtual:windi.css'
import { uniStorage } from './utils/storage'
export function createApp() {
const app = createSSRApp(App)
app.use(Pinia.createPinia())
app.use(locale)
app.use(uviewPlus)
uniStorage()
return {
app,
Pinia
}
}

23618
uni-app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,84 @@
{ {
"dependencies": { "name": "uni-preset-vue",
"lodash-es": "^4.17.21", "version": "0.0.0",
"sortablejs": "^1.15.0", "scripts": {
"uview-plus": "^3.1.29", "dev:app": "uni -p app",
"vue-i18n": "^9.2.2", "dev:app-android": "uni -p app-android",
"weixin-js-sdk": "^1.6.0" "dev:app-ios": "uni -p app-ios",
}, "dev:custom": "uni -p",
"devDependencies": { "dev:h5": "uni",
"@dcasia/mini-program-tailwind-webpack-plugin": "^1.5.6", "dev:h5:ssr": "uni --ssr",
"@rollup/plugin-commonjs": "^24.0.1", "dev:mp-alipay": "uni -p mp-alipay",
"@types/sortablejs": "^1.15.0", "dev:mp-baidu": "uni -p mp-baidu",
"vite-plugin-windicss": "^1.8.10", "dev:mp-jd": "uni -p mp-jd",
"windicss": "^3.5.6" "dev:mp-kuaishou": "uni -p mp-kuaishou",
} "dev:mp-lark": "uni -p mp-lark",
} "dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao",
"dev:mp-weixin": "uni -p mp-weixin",
"dev:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
"build:app": "uni build -p app",
"build:app-android": "uni build -p app-android",
"build:app-ios": "uni build -p app-ios",
"build:custom": "uni build -p",
"build:h5": "uni build",
"build:h5:ssr": "uni build --ssr",
"build:mp-alipay": "uni build -p mp-alipay",
"build:mp-baidu": "uni build -p mp-baidu",
"build:mp-jd": "uni build -p mp-jd",
"build:mp-kuaishou": "uni build -p mp-kuaishou",
"build:mp-lark": "uni build -p mp-lark",
"build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao",
"build:mp-weixin": "uni build -p mp-weixin",
"build:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"type-check": "vue-tsc --noEmit"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-3080720230703001",
"@dcloudio/uni-app-plus": "3.0.0-3080720230703001",
"@dcloudio/uni-components": "3.0.0-3080720230703001",
"@dcloudio/uni-h5": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-alipay": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-baidu": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-jd": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-lark": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-qq": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-toutiao": "3.0.0-3080720230703001",
"@dcloudio/uni-mp-weixin": "3.0.0-3080720230703001",
"@dcloudio/uni-quickapp-webview": "3.0.0-3080720230703001",
"html2canvas": "^1.4.1",
"image-tools": "^1.4.0",
"lodash-es": "^4.17.21",
"pinia": "^2.0.36",
"qrcode": "^1.5.1",
"sortablejs": "^1.15.0",
"uview-plus": "^3.1.29",
"vue": "^3.3.0",
"vue-i18n": "^9.2.2",
"weixin-js-sdk": "^1.6.0"
},
"devDependencies": {
"@dcasia/mini-program-tailwind-webpack-plugin": "^1.5.6",
"@dcloudio/types": "^3.3.2",
"@dcloudio/uni-automator": "3.0.0-3080720230703001",
"@dcloudio/uni-cli-shared": "3.0.0-3080720230703001",
"@dcloudio/uni-stacktracey": "3.0.0-3080720230703001",
"@dcloudio/vite-plugin-uni": "3.0.0-3080720230703001",
"@rollup/plugin-commonjs": "^24.0.1",
"@types/qrcode": "^1.5.0",
"@types/sortablejs": "^1.15.0",
"@vue/tsconfig": "^0.1.3",
"sass": "^1.54.5",
"typescript": "^4.9.4",
"vite": "4.0.4",
"vite-plugin-windicss": "^1.8.10",
"vue-tsc": "^1.0.24",
"windicss": "^3.5.6"
}
}

View File

@ -1,66 +0,0 @@
<template>
<view class="bg-white">
<block v-if="!loading">
<view class="border-solid border-t-0 border-l-0 border-r-0 border-b-[1px] border-gray-200 p-[10px]">
<view class="text-[16px]">
{{articleDetail.title}}
</view>
<view class="flex align-center justify-between text-[12px] text-gray-400 mt-[15px]">
<text>{{articleDetail.create_time}}</text>
</view>
</view>
<view class="mx-[10px] my-[10px] bg-gray-100 p-[8px] text-[14px] rounded-[5px] leading-[1.3]">
{{t('abstract')}}{{articleDetail.summary}}
</view>
<view class="px-[10px] pd-[10px]">
<u-parse :content="articleDetail.content" :tagStyle="style"></u-parse>
</view>
</block>
<u-loading-page bg-color="rgb(248,248,248)" :loading="loading" fontSize="16" color="#333"
:loadingText="t('loadingText')"></u-loading-page>
</view>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { t } from '@/locale'
import { getArticleDetail } from '@/api/article';
import { useShare } from '@/hooks/useShare'
const { setShare, onShareAppMessage, onShareTimeline } = useShare()
onShareAppMessage()
onShareTimeline()
let articleDetail = ref<Array<any>>([]);
let loading = ref<boolean>(true);
let style = {
h2: 'margin-bottom: 15px;',
p: 'margin-bottom: 10px;line-height: 1.5;',
img: 'margin: 10px 0;',
};
onLoad((option) => {
loading.value = true;
getArticleDetail(option.id).then((res) => {
articleDetail.value = res.data;
loading.value = false;
let share = {
title: articleDetail.value.title,
desc: articleDetail.value.intro,
url: articleDetail.value.image
}
uni.setNavigationBarTitle({
title: articleDetail.value.title
})
setShare({
wechat: {
...share
},
weapp: {
...share
}
});
});
})
</script>
<style lang="scss" scoped></style>

View File

@ -1,166 +0,0 @@
<template>
<view class="bg-gray-100 min-h-[100vh]">
<view class="fixed top-0 inset-x-0 z-10">
<view
class='p-[10px] bg-white border-solid border-t-0 border-l-0 border-r-0 border-b-[1px] border-gray-200'>
<u-search :placeholder="t('searchPlaceholder')" actionText :actionStyle="{'width':0,'margin':0}"
v-model="articleTitle" @clickIcon="searchFn"></u-search>
</view>
<scroll-view :scroll-x="true" :enable-flex="true"
class="nav-list bg-white align-center px-[10px] box-border">
<view class="flex scroll-view-wrap">
<view
:class="['nav-item text-[14px] mx-[5px] h-[30px] leading-[30px] my-[5px] border-t-0 border-l-0 border-r-0',{'border-solid border-b-[2px] active': currCategoryId==item.category_id}]"
@click="loadCategory(item.category_id)" v-for="(item,index) in categoryList"
:key="item.category_id">
{{item.name}}
</view>
</view>
</scroll-view>
</view>
<mescroll-body ref="mescrollRef" @init="mescrollInit" top="220rpx" @down="downCallback" @up="getArticleListFn">
<view v-for="(item,index) in articleList" :key="item.id"
:class="['bg-white flex align-center p-[10px]',{'border-solid border-t-0 border-l-0 border-r-0 border-b-[1px] border-gray-200': articleList.length-1 !== index}] "
@click="toLink(item.id)">
<u--image width="260rpx" height="200rpx" :src="img(item.image)" v-if="item.image" model="aspectFill">
<template #error>
<u-icon name="photo" color="#999" size="50"></u-icon>
</template>
</u--image>
<view class="flex-1 flex flex-col justify-between ml-[10px]">
<view class="text-[16px] leading-[1.3] multi-hidden mt-[2px]">{{item.title}}</view>
<view class="text-[14px] using-hidden mb-[auto] mt-[10px] text-gray-500">{{item.summary}}</view>
<view class="text-[12px] text-gray-400 flex justify-between mb-[5px]">
<text class="">{{item.create_time}}</text>
</view>
</view>
</view>
<mescroll-empty v-if="!articleList.length && loading"></mescroll-empty>
</mescroll-body>
<tabbar />
</view>
</template>
<script setup lang="ts">
import { reactive, ref, onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { t } from '@/locale'
import { redirect, img } from '@/utils/common';
import { getArticleList, getArticleCategory } from '@/api/article';
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app';
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom);
import { useShare } from '@/hooks/useShare'
const { setShare, onShareAppMessage, onShareTimeline } = useShare()
setShare()
onShareAppMessage()
onShareTimeline()
let categoryList = ref<Array<Object>>([]);
let articleList = ref<Array<any>>([]);
let currCategoryId = ref<number | string>('');
let articleTitle = ref<string>('');
let mescrollRef = ref(null);
let loading = ref<boolean>(false);
interface acceptingDataStructure {
data : acceptingDataItemStructure,
msg : string,
code : number
}
interface acceptingDataItemStructure {
data : object,
[propName : string] : number | string | object
}
onLoad(async () => {
await getArticleCategory().then((res : acceptingDataStructure) => {
const initData = { name: t("all"), category_id: '' };
categoryList.value.push(initData);
categoryList.value = categoryList.value.concat(res.data.data);
});
})
interface mescrollStructure {
num : number,
size : number,
endSuccess : Function,
[propName : string] : any
}
const getArticleListFn = (mescroll : mescrollStructure) => {
loading.value = false;
let data : object = {
category_id: currCategoryId.value,
title: articleTitle.value,
page: mescroll.num,
limit: mescroll.size
};
getArticleList(data).then((res : acceptingDataStructure) => {
let newArr = (res.data.data as Array<Object>);
//
if (mescroll.num == 1) {
articleList.value = []; //
}
articleList.value = articleList.value.concat(newArr);
mescroll.endSuccess(newArr.length);
loading.value = true;
}).catch(() => {
loading.value = true;
mescroll.endErr(); // ,
})
}
const loadCategory = (id : string) => {
currCategoryId.value = id;
getMescroll().resetUpScroll();
}
const searchFn = () => {
getMescroll().resetUpScroll();
}
const toLink = (id : string) => {
redirect({ url: '/pages/article/detail', param: { id } })
}
onMounted(() => {
setTimeout(() => {
getMescroll().optUp.textNoMore = t("end");
}, 500)
});
</script>
<style lang="scss" scoped>
.nav-item.active {
color: $u-primary;
}
.scroll-view-wrap {
word-break: keep-all;
}
/* 单行超出隐藏 */
.using-hidden {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
white-space: break-spaces;
}
/* 多行超出隐藏 */
.multi-hidden {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>

View File

@ -1,16 +0,0 @@
<template>
<view class="w-screen h-screen flex flex-col items-center justify-center">
<u-empty
:icon="img('static/resource/images/site/close.png')"
:text="t('siteClose')"
>
</u-empty>
</view>
</template>
<script setup lang="ts">
import { img } from '@/utils/common'
import { t } from '@/locale'
</script>
<style lang="scss" scoped></style>

View File

@ -1,16 +0,0 @@
<template>
<view class="w-screen h-screen flex flex-col items-center justify-center">
<u-empty
:icon="img('static/resource/images/site/close.png')"
:text="t('noSite')"
>
</u-empty>
</view>
</template>
<script setup lang="ts">
import { img } from '@/utils/common'
import { t } from '@/locale'
</script>
<style lang="scss" scoped></style>

View File

@ -2,15 +2,16 @@
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app' import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import manifest from '@/manifest.json' import manifest from '@/manifest.json'
import { redirectInterceptor, launchInterceptor } from '@/utils/interceptor' import { redirectInterceptor, launchInterceptor } from '@/utils/interceptor'
import { getToken, isWeixinBrowser, getSiteId } from '@/utils/common' import { getToken, isWeixinBrowser } from '@/utils/common'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import useConfigStore from '@/stores/config' import useConfigStore from '@/stores/config'
import useSystemStore from '@/stores/system'
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'
import { language } from '@/locale' import { language } from './locale'
// #ifdef H5 // #ifdef H5
if (import.meta.env.VITE_APP_DEBUG) { new window.VConsole() } if (import.meta.env.VITE_APP_DEBUG) {
new window.VConsole()
}
// #endif // #endif
onLaunch(async (data) => { onLaunch(async (data) => {
@ -22,16 +23,33 @@
// #ifdef H5 // #ifdef H5
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href)) uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
// id //
if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return; window.parent.postMessage(JSON.stringify({
type: 'appOnLaunch',
message: '初始化加载完成'
}), '*');
//
window.addEventListener('message', event => {
try {
let data = JSON.parse(event.data);
if (data.type == 'appOnReady') {
window.parent.postMessage(JSON.stringify({
type: 'appOnReady',
message: '加载完成'
}), '*');
}
} catch (e) {
console.log('uniapp app接受数据错误', e)
}
}, false);
// #endif // #endif
const configStore = useConfigStore() const configStore = useConfigStore()
configStore.getTabbarConfig() configStore.getTabbarConfig()
await configStore.getLoginConfig() await configStore.getLoginConfig()
useSystemStore().getSitenfo()
// tabbar // tabbar
uni.hideTabBar() uni.hideTabBar()
@ -72,7 +90,7 @@
</script> </script>
<style> <style>
uni-page-head { uni-page-head {
display: none!important; display: none !important;
} }
</style> </style>

View File

@ -3,15 +3,15 @@ import request from '@/utils/request'
/** /**
* *
*/ */
export function usernameLogin(data : AnyObject) { export function usernameLogin(data: AnyObject) {
return request.get('login', data, { showErrorMessage: true }) return request.get('login', data, {showErrorMessage: true})
} }
/** /**
* *
*/ */
export function mobileLogin(data : AnyObject) { export function mobileLogin(data: AnyObject) {
return request.post('login/mobile', data, { showErrorMessage: true }) return request.post('login/mobile', data, {showErrorMessage: true})
} }
/** /**
@ -31,47 +31,47 @@ export function logout() {
/** /**
* *
*/ */
export function usernameRegister(data : AnyObject) { export function usernameRegister(data: AnyObject) {
let url = 'register' let url = 'register'
data.pid && (url += `?pid=${data.pid}`) data.pid && (url += `?pid=${data.pid}`)
return request.post(url, data, { showErrorMessage: true }) return request.post(url, data, {showErrorMessage: true})
} }
/** /**
* *
*/ */
export function mobileRegister(data : AnyObject) { export function mobileRegister(data: AnyObject) {
let url = 'register/mobile' let url = 'register/mobile'
data.pid && (url += `?pid=${data.pid}`) data.pid && (url += `?pid=${data.pid}`)
return request.post(url, data, { showErrorMessage: true }) return request.post(url, data, {showErrorMessage: true})
} }
/** /**
* *
*/ */
export function wechatLogin(data : AnyObject) { export function wechatLogin(data: AnyObject) {
return request.post('wechat/login', data) return request.post('wechat/login', data)
} }
/** /**
* *
*/ */
export function weappLogin(data : AnyObject) { export function weappLogin(data: AnyObject) {
return request.post('weapp/login', data) return request.post('weapp/login', data)
} }
/** /**
* *
*/ */
export function bind(data : AnyObject) { export function bind(data: AnyObject) {
let url = 'bind' let url = 'bind'
data.pid && (url += `?pid=${data.pid}`) data.pid && (url += `?pid=${data.pid}`)
return request.post(url, data, { showErrorMessage: true }) return request.post(url, data, {showErrorMessage: true})
} }
/** /**
* 访 * 访
*/ */
export function memberLog(data : AnyObject) { export function memberLog(data: AnyObject) {
return request.post('member/log', data, { showErrorMessage: false }) return request.post('member/log', data, {showErrorMessage: false})
} }

View File

@ -0,0 +1,22 @@
import request from '@/utils/request'
/**
*
*/
export function getDiyInfo(params: Record<string, any>) {
return request.get('diy/diy', params)
}
/**
*
*/
export function getTabbarInfo() {
return request.get('diy/tabbar')
}
/**
*
*/
export function getShareInfo(params: Record<string, any>) {
return request.get('diy/share', params)
}

View File

@ -0,0 +1,169 @@
import request from '@/utils/request'
export function getMemberInfo() {
return request.get('member/member')
}
/**
*
*/
export function getPointList(data: AnyObject) {
return request.get('member/account/point', data)
}
/**
*
*/
export function getBalanceList(data: AnyObject) {
return request.get('member/account/balance', data)
}
/**
*
*/
export function getMoneyList(data: AnyObject) {
return request.get('member/account/money', data)
}
/**
*
*/
export function modifyMember(data: AnyObject) {
return request.put(`member/modify/${data.field}`, data, {showErrorMessage: true})
}
/**
*
*/
export function createRecharge(data: AnyObject) {
return request.post('recharge/recharge', data, {showErrorMessage: true})
}
/**
*
*/
export function getRechargeList(data: AnyObject) {
return request.get('recharge/recharge', data, {showErrorMessage: true})
}
/**
*
*/
export function getRechargeDetail(id: number) {
return request.get(`recharge/recharge/${id}`, {}, {showErrorMessage: true})
}
/**
*
*/
export function bindMobile(data: AnyObject) {
return request.put('member/mobile', data, {showErrorMessage: true})
}
/**
*
*/
export function cashOutTransferType() {
return request.get('member/cash_out/transfertype')
}
/**
*
*/
export function cashOutConfig() {
return request.get('member/cash_out/config')
}
/**
*
*/
export function cashOutApply(data: AnyObject) {
return request.post('member/cash_out/apply', data, {showSuccessMessage: true, showErrorMessage: true})
}
/**
*
*/
export function getCashoutAccountInfo(data: AnyObject) {
return request.get(`member/cashout_account/${data.account_id}`, {})
}
/**
*
*/
export function getFirstCashoutAccountInfo(data: AnyObject) {
return request.get('member/cashout_account/firstinfo', data)
}
/**
*
*/
export function getCashoutAccountList(data: AnyObject) {
return request.get(`member/cashout_account`, data)
}
/**
*
*/
export function getCashOutList(data: AnyObject) {
return request.get(`member/cash_out`, data)
}
/**
*
*/
export function getCashOutDetail(id: number) {
return request.get(`member/cash_out/${id}`)
}
/**
*
*/
export function addCashoutAccount(data: AnyObject) {
return request.post('member/cashout_account', data, {showSuccessMessage: true, showErrorMessage: true})
}
/**
*
*/
export function editCashoutAccount(data: AnyObject) {
return request.put(`member/cashout_account/${data.account_id}`, data, {
showSuccessMessage: true,
showErrorMessage: true
})
}
/**
*
*/
export function deleteCashoutAccount(accountId: number) {
return request.delete(`member/cashout_account/${accountId}`, {showSuccessMessage: true, showErrorMessage: true})
}
/**
*
*/
export function getCommissionList(data: AnyObject) {
return request.get(`member/account/commission`, data)
}
/**
*
*/
export function setCollect(data: AnyObject){
return request.post(`member/collect`, data)
}
/**
*
*/
export function getCollect(data: AnyObject){
return request.get(`member/collect`, data)
}
/**
*
*/
export function deleteCollect(id: number){
return request.delete(`member/collect/${id}`)
}

View File

@ -0,0 +1,15 @@
import request from '@/utils/request'
/**
*
*/
export function pay(data: AnyObject) {
return request.post(`pay`, data, {showErrorMessage: true})
}
/**
*
*/
export function getPayInfo(tradeType: string, tradeId: number) {
return request.get(`pay/info/${tradeType}/${tradeId}`, {}, {showErrorMessage: true})
}

View File

@ -4,82 +4,82 @@ import request from '@/utils/request'
* *
*/ */
export function getCaptcha() { export function getCaptcha() {
return request.get('captcha', {}, { showErrorMessage: true }) return request.get('captcha', {}, { showErrorMessage: true })
} }
/** /**
* *
*/ */
export function getWechatAuthCode(data : AnyObject) { export function getWechatAuthCode(data : AnyObject) {
return request.get('wechat/codeurl', data) return request.get('wechat/codeurl', data)
} }
/** /**
* *
*/ */
export function wechatSync(data : AnyObject) { export function wechatSync(data : AnyObject) {
return request.post('wechat/sync', data) return request.post('wechat/sync', data)
} }
/** /**
* *
*/ */
export function getAgreementInfo(key : string) { export function getAgreementInfo(key : string) {
return request.get(`agreement/${key}`) return request.get(`agreement/${key}`)
} }
/** /**
* *
*/ */
export function resetPassword(data : AnyObject) { export function resetPassword(data : AnyObject) {
return request.post(`password/reset`, data, { showErrorMessage: true }) return request.post(`password/reset`, data, { showErrorMessage: true })
} }
/** /**
* *
*/ */
export function sendSms(data : AnyObject) { export function sendSms(data : AnyObject) {
return request.post(`send/mobile/${data.type}`, data, { showErrorMessage: true }) return request.post(`send/mobile/${data.type}`, data, { showErrorMessage: true })
} }
/** /**
* jssdk config * jssdk config
*/ */
export function getWechatSkdConfig(data : AnyObject) { export function getWechatSkdConfig(data : AnyObject) {
return request.get('wechat/jssdkconfig', data) return request.get('wechat/jssdkconfig', data)
} }
/** /**
* *
*/ */
export function uploadImage(data : AnyObject) { export function uploadImage(data : AnyObject) {
return request.upload('file/image', data, { showErrorMessage: true }) return request.upload('file/image', data, { showErrorMessage: true })
} }
/** /**
* *
*/ */
export function fetchImage(data : AnyObject) { export function fetchImage(data : AnyObject) {
return request.post('file/image/fetch', data) return request.post('file/image/fetch', data)
} }
/** /**
* base64图片 * base64图片
*/ */
export function fetchBase64Image(data : AnyObject) { export function fetchBase64Image(data : AnyObject) {
return request.post('file/image/base64', data) return request.post('file/image/base64', data)
}
/**
*
*/
export function getSiteInfo() {
return request.get('site')
} }
/** /**
* id * id
*/ */
export function getWeappTemplateId(keys: string) { export function getWeappTemplateId(keys : string) {
return request.get('weapp/subscribemsg', { keys }) return request.get('weapp/subscribemsg', { keys })
}
/**
*
*/
export function getWapIndexList(data : AnyObject) {
return request.get('wap_index', data)
} }

View File

@ -0,0 +1,120 @@
<template>
<view :style="warpCss">
<view v-for="(item,index) in list" :key="item.id"
:class="['item flex align-center p-[20rpx] mb-[20rpx]',{'border-solid border-t-0 border-l-0 border-r-0 border-b border-gray-200': list.length-1 !== index}] "
@click="toLink(item.url)">
<u--image width="120rpx" height="120rpx" :src="img(item.icon)" v-if="item.icon"
class="rounded-md overflow-hidden" model="aspectFill">
<template #error>
<u-icon name="photo" color="#999" size="60"></u-icon>
</template>
</u--image>
<view class="flex-1 flex flex-col justify-center ml-[20rpx]">
<view class="text-sm leading-[1.3] using-hidden">{{item.title}}</view>
<view class="text-xs text-[#999] mt-[8rpx] leading-[1.6] multi-hidden">{{item.desc}}</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
//
import { ref, computed, watch, onMounted } from 'vue';
import { redirect, img } from '@/utils/common';
import useDiyStore from '@/app/stores/diy';
import { getWapIndexList } from '@/app/api/system';
const props = defineProps(['component', 'index', 'pullDownRefresh']);
const diyStore = useDiyStore();
const diyComponent = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore.value[props.index];
} else {
return props.component;
}
})
const warpCss = computed(() => {
var style = '';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
if (diyComponent.value.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
return style;
})
const list = ref([])
watch(
() => props.pullDownRefresh,
(newValue, oldValue) => {
//
}
)
onMounted(() => {
refresh();
//
if (diyStore.mode == 'decorate') {
watch(
() => diyComponent.value,
(newValue, oldValue) => {
if (newValue && newValue.componentName == 'AddonList') {
refresh();
}
}
)
}
});
const refresh = () => {
//
if (diyStore.mode == 'decorate') {
diyComponent.value.list.forEach((item : any, index) => {
if (item.icon == '') {
item.icon = 'static/resource/images/diy/figure.png';
}
if (item.title == '') {
item.title = '应用名称';
}
});
}
if (diyComponent.value.list.length == 0) {
getWapIndexList().then((res) => {
list.value = res.data;
})
} else {
list.value = diyComponent.value.list;
}
}
const toLink = (url : string) => {
redirect({ url })
}
</script>
<style lang="scss" scoped>
/* 单行超出隐藏 */
.using-hidden {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
white-space: break-spaces;
}
/* 多行超出隐藏 */
.multi-hidden {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>

View File

@ -1,9 +1,16 @@
<template> <template>
<view :style="warpCss"> <view :style="warpCss">
<div v-if="diyComponent.navTitle" class="py-[30rpx] px-[32rpx] text-[30rpx]" <view class="flex items-center justify-between py-[30rpx] px-[32rpx]">
:style="{fontWeight: diyComponent.font.weight,color:diyComponent.font.color}"> <view v-if="diyComponent.navTitle" class="text-[30rpx]"
{{diyComponent.navTitle}} :style="{fontWeight: diyComponent.font.weight,color:diyComponent.font.color}">
</div> {{diyComponent.navTitle}}
</view>
<app-link v-if="diyComponent.subNavTitle" :data="diyComponent.subNavTitleLink" class="flex items-baseline"
:style="{ color: diyComponent.subNavColor}">
<text class="text-[26rpx] mr-[4rpx]">{{diyComponent.subNavTitle}}</text>
<text class="text-sm iconfont iconxiangyoujiantou"></text>
</app-link>
</view>
<view v-if="diyComponent.layout == 'vertical'" class="graphic-nav"> <view v-if="diyComponent.layout == 'vertical'" class="graphic-nav">
<view class="graphic-nav-item" v-for="(item, index) in diyComponent.list" :key="item.id"> <view class="graphic-nav-item" v-for="(item, index) in diyComponent.list" :key="item.id">
@ -121,7 +128,7 @@
// //
import { ref, onMounted, watch, computed } from 'vue'; import { ref, onMounted, watch, computed } from 'vue';
import { img, diyRedirect, currRoute, getToken } from '@/utils/common'; import { img, diyRedirect, currRoute, getToken } from '@/utils/common';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
import { useLogin } from '@/hooks/useLogin'; import { useLogin } from '@/hooks/useLogin';
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);
@ -217,7 +224,7 @@
const redirectTo = (link : any) => { const redirectTo = (link : any) => {
if (link.url) { if (link.url) {
if (currRoute() == 'pages/member/index' && !getToken()) { if (currRoute() == '/app/pages/member/index' && !getToken()) {
useLogin().setLoginBack({ url: link.url }) useLogin().setLoginBack({ url: link.url })
return; return;
} }

View File

@ -13,7 +13,6 @@
cursor: move; cursor: move;
border-style: dotted; border-style: dotted;
} }
&.selected:before { &.selected:before {
content: ''; content: '';
position: absolute; position: absolute;

View File

@ -0,0 +1,83 @@
<template>
<view class="diy-group" id="componentList">
<view v-for="(component, index) in data.value" :key="component.id"
@click="diyStore.changeCurrentIndex(index, component)" class="draggable-element relative cursor-move"
:class="{ selected: diyStore.currentIndex == index,decorate : diyStore.mode == 'decorate' }" :style="component.pageStyle">
<template v-if="component.componentName == 'AddonList'">
<diy-addon-list :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-addon-list>
</template>
<template v-if="component.componentName == 'GraphicNav'">
<diy-graphic-nav :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-graphic-nav>
</template>
<template v-if="component.componentName == 'HorzBlank'">
<diy-horz-blank :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-horz-blank>
</template>
<template v-if="component.componentName == 'HotArea'">
<diy-hot-area :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-hot-area>
</template>
<template v-if="component.componentName == 'ImageAds'">
<diy-image-ads :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-image-ads>
</template>
<template v-if="component.componentName == 'MemberInfo'">
<diy-member-info :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-member-info>
</template>
<template v-if="component.componentName == 'RubikCube'">
<diy-rubik-cube :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-rubik-cube>
</template>
<template v-if="component.componentName == 'Text'">
<diy-text :component="component" :index="index" :pullDownRefresh="props.pullDownRefresh"></diy-text>
</template>
</view>
<template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">
<view class="pt-[20rpx]"></view>
<tabbar />
</template>
</view>
</template>
<script lang="ts" setup>
import useDiyStore from '@/app/stores/diy';
import { onMounted, nextTick, computed, ref,watch } from 'vue';
import Sortable from 'sortablejs';
import { range } from 'lodash-es';
const props = defineProps(['data','pullDownRefresh']);
const diyStore = useDiyStore();
const data = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore;
} else {
return props.data;
}
})
onMounted(() => {
// #ifdef H5
if (diyStore.mode == 'decorate') {
var el = document.getElementById('componentList');
const sortable = Sortable.create(el, {
group: 'draggable-element',
animation: 200,
//
onEnd: event => {
let temp = diyStore.value[event.oldIndex!];
diyStore.value.splice(event.oldIndex!, 1);
diyStore.value.splice(event.newIndex!, 0, temp);
nextTick(() => {
sortable.sort(
range(diyStore.value.length).map(value => {
return value.toString();
})
);
diyStore.postMessage(event.newIndex, diyStore.value[event.newIndex]);
});
}
});
}
// #endif
});
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>

View File

@ -6,7 +6,7 @@
<script setup lang="ts"> <script setup lang="ts">
// //
import { computed, watch } from 'vue'; import { computed, watch } from 'vue';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);

View File

@ -22,7 +22,7 @@
<script setup lang="ts"> <script setup lang="ts">
// //
import { computed, watch, onMounted } from 'vue'; import { computed, watch, onMounted } from 'vue';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
import { img } from '@/utils/common'; import { img } from '@/utils/common';
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);

View File

@ -25,7 +25,7 @@
// 广 // 广
import { ref, onMounted, watch, computed } from 'vue'; import { ref, onMounted, watch, computed } from 'vue';
import { img } from '@/utils/common'; import { img } from '@/utils/common';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);

View File

@ -11,7 +11,7 @@
UID{{ info.member_no }}</view> UID{{ info.member_no }}</view>
</view> </view>
<view class="set-icon flex items-center absolute right-0 top-2"> <view class="set-icon flex items-center absolute right-0 top-2">
<app-link url="/pages/setting/index"> <app-link url="/app/pages/setting/index">
<text class="iconfont iconshezhi text-[1.6rem] ml-[10rpx]" <text class="iconfont iconshezhi text-[1.6rem] ml-[10rpx]"
:style="{ color : diyComponent.textColor }"></text> :style="{ color : diyComponent.textColor }"></text>
</app-link> </app-link>
@ -25,7 +25,7 @@
</view> </view>
</view> </view>
<view class="set-icon flex items-center absolute right-0 top-2"> <view class="set-icon flex items-center absolute right-0 top-2">
<app-link url="/pages/setting/index"> <app-link url="/app/pages/setting/index">
<text class="iconfont iconshezhi text-[1.6rem] ml-[10rpx]" <text class="iconfont iconshezhi text-[1.6rem] ml-[10rpx]"
:style="{ color : diyComponent.textColor }"></text> :style="{ color : diyComponent.textColor }"></text>
</app-link> </app-link>
@ -35,22 +35,22 @@
<view class="flex m-[30rpx] mb-0 py-[30rpx] items-center"> <view class="flex m-[30rpx] mb-0 py-[30rpx] items-center">
<view class="flex-1 text-center"> <view class="flex-1 text-center">
<view class="font-bold"> <view class="font-bold">
<app-link :url="(info ? '/pages/member/balance' : '')" <app-link :url="(info ? '/app/pages/member/balance' : '')"
:style="{ color : diyComponent.textColor }">{{ money }}</app-link> :style="{ color : diyComponent.textColor }">{{ money }}</app-link>
</view> </view>
<view class="text-sm mt-[10rpx]"> <view class="text-sm mt-[10rpx]">
<app-link :url="(info ? '/pages/member/balance' : '')" <app-link :url="(info ? '/app/pages/member/balance' : '')"
:style="{ color : diyComponent.textColor }">{{ t('balance') }}</app-link> :style="{ color : diyComponent.textColor }">{{ t('balance') }}</app-link>
</view> </view>
</view> </view>
<view class="border-solid border-white border-l border-b-0 border-t-0 border-r-0 h-[60rpx]"></view> <view class="border-solid border-white border-l border-b-0 border-t-0 border-r-0 h-[60rpx]"></view>
<view class="flex-1 text-center"> <view class="flex-1 text-center">
<view class="font-bold"> <view class="font-bold">
<app-link :url="(info ? '/pages/member/point' : '')" <app-link :url="(info ? '/app/pages/member/point' : '')"
:style="{ color : diyComponent.textColor }">{{ parseInt(info?.point) || 0 }}</app-link> :style="{ color : diyComponent.textColor }">{{ parseInt(info?.point) || 0 }}</app-link>
</view> </view>
<view class="text-sm mt-[10rpx]"> <view class="text-sm mt-[10rpx]">
<app-link :url="(info ? '/pages/member/point' : '')" <app-link :url="(info ? '/app/pages/member/point' : '')"
:style="{ color : diyComponent.textColor }">{{ t('point') }}</app-link> :style="{ color : diyComponent.textColor }">{{ t('point') }}</app-link>
</view> </view>
</view> </view>
@ -69,8 +69,8 @@
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'
import { img, isWeixinBrowser, redirect, urlDeconstruction, moneyFormat } from '@/utils/common' import { img, isWeixinBrowser, redirect, urlDeconstruction, moneyFormat } from '@/utils/common'
import { t } from '@/locale' import { t } from '@/locale'
import { wechatSync } from '@/api/system' import { wechatSync } from '@/app/api/system'
import useDiyStore from '@/stores/diy' import useDiyStore from '@/app/stores/diy'
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);
@ -89,7 +89,7 @@
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';'; if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
if (diyComponent.value.bgUrl) { if (diyComponent.value.bgUrl) {
style += 'background-image:url(' + img(diyComponent.value.bgUrl) + ');'; style += 'background-image:url(' + img(diyComponent.value.bgUrl) + ');';
style += 'background-size: 100%;'; style += 'background-size: cover;';
style += 'background-repeat: no-repeat;'; style += 'background-repeat: no-repeat;';
} }
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;'; if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
@ -143,7 +143,7 @@
}) })
const toLogin = () => { const toLogin = () => {
useLogin().setLoginBack({ url: '/pages/member/index' }) useLogin().setLoginBack({ url: '/app/pages/member/index' })
} }
const infoFill = ref(false) const infoFill = ref(false)
@ -156,7 +156,7 @@
if (isWeixinBrowser()) { if (isWeixinBrowser()) {
useLogin().getAuthCode('snsapi_userinfo') useLogin().getAuthCode('snsapi_userinfo')
} else { } else {
redirect({ url: '/pages/member/personal' }) redirect({ url: '/app/pages/member/personal' })
} }
// #endif // #endif
} }

View File

@ -5,7 +5,7 @@
<template v-if="diyComponent.mode == 'row1-lt-of2-rt'"> <template v-if="diyComponent.mode == 'row1-lt-of2-rt'">
<view class="template-left"> <view class="template-left">
<app-link :data="diyComponent.list[0].link" :class="['item', diyComponent.mode]" <app-link :data="diyComponent.list[0].link" :class="['item', diyComponent.mode]"
:style="{ marginRight: diyComponent.imageGap * 2 + 'rpx', width: diyComponent.list[0].imgWidth, height: diyComponent.list[0].imgHeight + 'px' }"> :style="{width: diyComponent.list[0].imgWidth, height: diyComponent.list[0].imgHeight + 'px' }">
<image :src="img(diyComponent.list[0].imageUrl)" mode="scaleToFill" <image :src="img(diyComponent.list[0].imageUrl)" mode="scaleToFill"
:style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true"></image> :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true"></image>
</app-link> </app-link>
@ -72,7 +72,7 @@
<script setup lang="ts"> <script setup lang="ts">
// //
import { onMounted, computed, watch } from 'vue'; import { onMounted, computed, watch } from 'vue';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
import { img } from '@/utils/common'; import { img } from '@/utils/common';
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);

View File

@ -40,7 +40,7 @@
// //
import { ref, computed, watch } from 'vue'; import { ref, computed, watch } from 'vue';
import { redirect, img } from '@/utils/common'; import { redirect, img } from '@/utils/common';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
const props = defineProps(['component', 'index', 'pullDownRefresh']); const props = defineProps(['component', 'index', 'pullDownRefresh']);
const diyStore = useDiyStore(); const diyStore = useDiyStore();

View File

@ -0,0 +1,13 @@
<template>
<view class="fixed-group">
<template v-if="props.data.global.component == 'demo-index'">
<fixed-demo-index :data="props.data" :pullDownRefresh="props.pullDownRefresh"></fixed-demo-index>
</template>
</view>
</template>
<script lang="ts" setup>
const props = defineProps(['data','pullDownRefresh']);
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>

View File

@ -35,8 +35,8 @@
import { t } from '@/locale' import { t } from '@/locale'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import { img } from '@/utils/common' import { img } from '@/utils/common'
import { modifyMember } from '@/api/member' import { modifyMember } from '@/app/api/member'
import { fetchBase64Image } from '@/api/system' import { fetchBase64Image } from '@/app/api/system'
const show = ref(false) const show = ref(false)
const loading = ref(false) const loading = ref(false)

View File

@ -2,8 +2,6 @@
"developTitle":"开发环境配置", "developTitle":"开发环境配置",
"baseUrl":"API请求地址", "baseUrl":"API请求地址",
"imgUrl":"图片服务器地址", "imgUrl":"图片服务器地址",
"siteId":"站点IDVITE_SITE_ID",
"siteIdPlaceholder": "请输入站点ID",
"pleaseEnterNumber":"请输入数字", "pleaseEnterNumber":"请输入数字",
"maximumCannotExceed":"最大不能超过" "maximumCannotExceed":"最大不能超过"

View File

@ -7,7 +7,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { getAgreementInfo } from '@/api/system' import { getAgreementInfo } from '@/app/api/system'
const agreement = ref(null) const agreement = ref(null)

View File

@ -31,10 +31,10 @@
</u-checkbox-group> </u-checkbox-group>
<view class="text-xs text-gray-400 flex flex-wrap"> <view class="text-xs text-gray-400 flex flex-wrap">
{{ t('agreeTips') }} {{ t('agreeTips') }}
<app-link url="/pages/auth/agreement?key=service"> <app-link url="/app/pages/auth/agreement?key=service">
<text class="text-primary">{{ t('userAgreement') }}</text> <text class="text-primary">{{ t('userAgreement') }}</text>
</app-link> </app-link>
<app-link url="/pages/auth/agreement?key=privacy"> <app-link url="/app/pages/auth/agreement?key=privacy">
<text class="text-primary">{{ t('privacyAgreement') }}</text> <text class="text-primary">{{ t('privacyAgreement') }}</text>
</app-link> </app-link>
</view> </view>
@ -60,8 +60,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue' import { ref, reactive, computed } from 'vue'
import { t } from '@/locale' import { t } from '@/locale'
import { bind } from '@/api/auth' import { bind } from '@/app/api/auth'
import { bindMobile } from '@/api/member' import { bindMobile } from '@/app/api/member'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import useConfigStore from '@/stores/config' import useConfigStore from '@/stores/config'
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'
@ -129,7 +129,7 @@
request(formData).then((res) => { request(formData).then((res) => {
if (info.value) { if (info.value) {
memberStore.getMemberInfo() memberStore.getMemberInfo()
redirect({ url: '/pages/member/personal', mode: 'redirectTo' }) redirect({ url: '/app/pages/member/personal', mode: 'redirectTo' })
} else { } else {
memberStore.setToken(res.data.token) memberStore.setToken(res.data.token)
useLogin().handleLoginBack() useLogin().handleLoginBack()
@ -158,7 +158,7 @@
uni.hideLoading() uni.hideLoading()
if (info.value) { if (info.value) {
memberStore.getMemberInfo() memberStore.getMemberInfo()
redirect({ url: '/pages/member/personal', mode: 'redirectTo' }) redirect({ url: '/app/pages/member/personal', mode: 'redirectTo' })
} else { } else {
memberStore.setToken(res.data.token) memberStore.setToken(res.data.token)
useLogin().handleLoginBack() useLogin().handleLoginBack()

View File

@ -47,10 +47,10 @@
</view> </view>
</view> </view>
<view class="flex text-xs justify-between mt-[20rpx] text-gray-400"> <view class="flex text-xs justify-between mt-[20rpx] text-gray-400">
<app-link url="/pages/auth/register">{{ t('noAccount') }} <app-link url="/app/pages/auth/register">{{ t('noAccount') }}
<text class="text-primary">{{ t('toRegister') }}</text> <text class="text-primary">{{ t('toRegister') }}</text>
</app-link> </app-link>
<app-link url="/pages/auth/resetpwd">{{ t('resetpwd') }}</app-link> <app-link url="/app/pages/auth/resetpwd">{{ t('resetpwd') }}</app-link>
</view> </view>
<view class="mt-[80rpx]"> <view class="mt-[80rpx]">
<u-button type="primary" :loading="loading" :loadingText="t('logining')" @click="handleLogin"> <u-button type="primary" :loading="loading" :loadingText="t('logining')" @click="handleLogin">
@ -62,11 +62,11 @@
</view> </view>
<view class="text-xs py-[50rpx] flex justify-center w-full" v-if="configStore.login.agreement_show"> <view class="text-xs py-[50rpx] flex justify-center w-full" v-if="configStore.login.agreement_show">
{{ t('agreeTips') }} {{ t('agreeTips') }}
<app-link url="/pages/auth/agreement?key=service"> <app-link url="/app/pages/auth/agreement?key=service">
<text class="text-primary">{{ t('userAgreement') }}</text> <text class="text-primary">{{ t('userAgreement') }}</text>
</app-link> </app-link>
{{ t('and') }} {{ t('and') }}
<app-link url="/pages/auth/agreement?key=privacy"> <app-link url="/app/pages/auth/agreement?key=privacy">
<text class="text-primary">{{ t('privacyAgreement') }}</text> <text class="text-primary">{{ t('privacyAgreement') }}</text>
</app-link> </app-link>
</view> </view>
@ -75,7 +75,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue' import { ref, reactive, computed } from 'vue'
import { usernameLogin, mobileLogin } from '@/api/auth' import { usernameLogin, mobileLogin } from '@/app/api/auth'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import useConfigStore from '@/stores/config' import useConfigStore from '@/stores/config'
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'

View File

@ -66,7 +66,7 @@
</view> </view>
</view> </view>
<view class="flex text-xs justify-between mt-[20rpx] text-gray-400"> <view class="flex text-xs justify-between mt-[20rpx] text-gray-400">
<app-link url="/pages/auth/login">{{ t('haveAccount') }}<text <app-link url="/app/pages/auth/login">{{ t('haveAccount') }}<text
class="text-primary">{{ t('toLogin') }}</text> class="text-primary">{{ t('toLogin') }}</text>
</app-link> </app-link>
</view> </view>
@ -80,11 +80,11 @@
</view> </view>
<view class="text-xs py-[50rpx] flex justify-center w-full" v-if="configStore.login.agreement_show"> <view class="text-xs py-[50rpx] flex justify-center w-full" v-if="configStore.login.agreement_show">
{{ t('registerAgreeTips') }} {{ t('registerAgreeTips') }}
<app-link url="/pages/auth/agreement?key=service"> <app-link url="/app/pages/auth/agreement?key=service">
<text class="text-primary">{{ t('userAgreement') }}</text> <text class="text-primary">{{ t('userAgreement') }}</text>
</app-link> </app-link>
{{ t('and') }} {{ t('and') }}
<app-link url="/pages/auth/agreement?key=privacy"> <app-link url="/app/pages/auth/agreement?key=privacy">
<text class="text-primary">{{ t('privacyAgreement') }}</text> <text class="text-primary">{{ t('privacyAgreement') }}</text>
</app-link> </app-link>
</view> </view>
@ -93,7 +93,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue' import { ref, reactive, computed } from 'vue'
import { usernameRegister, mobileRegister } from '@/api/auth' import { usernameRegister, mobileRegister } from '@/app/api/auth'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import useConfigStore from '@/stores/config' import useConfigStore from '@/stores/config'
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'

View File

@ -53,7 +53,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { t } from '@/locale' import { t } from '@/locale'
import { resetPassword } from '@/api/system' import { resetPassword } from '@/app/api/system'
import { redirect } from '@/utils/common' import { redirect } from '@/utils/common'
const formData = reactive({ const formData = reactive({
@ -118,7 +118,7 @@
loading.value = true loading.value = true
resetPassword(formData).then((res : responseResult) => { resetPassword(formData).then((res : responseResult) => {
redirect({ url: '/pages/auth/login', mode: 'redirectTo' }) redirect({ url: '/app/pages/auth/login', mode: 'redirectTo' })
}).catch(() => { }).catch(() => {
loading.value = false loading.value = false
}) })

View File

@ -9,10 +9,6 @@
<text class="mb-[10rpx]">{{ t('imgUrl') }}</text> <text class="mb-[10rpx]">{{ t('imgUrl') }}</text>
<text class="text-sm">{{formData.imgUrl}}</text> <text class="text-sm">{{formData.imgUrl}}</text>
</view> </view>
<view class="mb-[40rpx] flex flex-col">
<text class="mb-[20rpx]">{{ t('siteId') }}</text>
<u-input v-model="formData.siteId" clearable :placeholder="t('siteIdPlaceholder')" />
</view>
<u-button type="primary" @click="save" class="mt-[80rpx]"> <u-button type="primary" @click="save" class="mt-[80rpx]">
{{ t('confirm') }} {{ t('confirm') }}
</u-button> </u-button>
@ -21,35 +17,18 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue' import { ref, reactive, computed } from 'vue'
import { img, redirect, getSiteId } from '@/utils/common' import { img, redirect } from '@/utils/common'
import { t } from '@/locale' import { t } from '@/locale'
import manifestJson from '@/manifest.json' import manifestJson from '@/manifest.json'
const formData = reactive({ const formData = reactive({
siteId: '',
baseUrl: import.meta.env.VITE_APP_BASE_URL || `${location.origin}/api/`, baseUrl: import.meta.env.VITE_APP_BASE_URL || `${location.origin}/api/`,
imgUrl: import.meta.env.VITE_IMG_DOMAIN imgUrl: import.meta.env.VITE_IMG_DOMAIN
}) })
const save = () => { const save = () => {
if (formData.siteId.length == 0) { let url = uni.getStorageSync('develop_before_path') || '/app/pages/index/index';
uni.showToast({ title: t('siteIdPlaceholder'), icon: 'none' }); if (url == '/app/pages/index/develop') url = '/app/pages/index/index';
return;
}
var reg = /^[0-9]+$/;
if (!reg.test(formData.siteId)) {
uni.showToast({ title: t('pleaseEnterNumber'), icon: 'none' });
return;
}
// if (formData.siteId > 9999999) {
// uni.showToast({ title: t('maximumCannotExceed') + '9999999', icon: 'none' });
// return;
// }
uni.setStorageSync('wap_site_id', formData.siteId);
let url = uni.getStorageSync('develop_before_path') || '/pages/index/index';
if (url == '/pages/index/develop') url = '/pages/index/index';
url = url.replace('/','') url = url.replace('/','')
uni.removeStorageSync('develop_before_path'); uni.removeStorageSync('develop_before_path');

View File

@ -2,7 +2,7 @@
<view> <view>
<u-loading-page :loading="loading" loadingText="" bg-color="#f7f7f7"></u-loading-page> <u-loading-page :loading="loading" loadingText="" bg-color="#f7f7f7"></u-loading-page>
<view v-show="!loading"> <view v-show="!loading">
<!-- 自定义模板渲染 --> <!-- 自定义模板渲染 -->
<view class="diy-template-wrap bg-index" v-if="data.pageMode != 'fixed'" <view class="diy-template-wrap bg-index" v-if="data.pageMode != 'fixed'"
@ -26,10 +26,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue'; import { ref, reactive, computed } from 'vue';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { getDiyInfo } from '@/api/diy'; import { getDiyInfo } from '@/app/api/diy';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
import { useShare } from '@/hooks/useShare' import { useShare } from '@/hooks/useShare'
import { img } from '@/utils/common'; import { img, redirect } from '@/utils/common';
const { setShare, onShareAppMessage, onShareTimeline } = useShare() const { setShare, onShareAppMessage, onShareTimeline } = useShare()
onShareAppMessage() onShareAppMessage()
@ -39,6 +39,11 @@
const diyStore = useDiyStore(); const diyStore = useDiyStore();
const pullDownRefresh = ref(0) const pullDownRefresh = ref(0)
const id = ref(0)
const name = ref('')
const template = ref('')
//
const diyData = reactive({ const diyData = reactive({
pageMode: 'diy', pageMode: 'diy',
title: '', title: '',
@ -54,9 +59,6 @@
} }
}) })
const id = ref(0)
const name = ref('')
onLoad(option => { onLoad(option => {
// #ifdef H5 // #ifdef H5
// //
@ -67,6 +69,7 @@
// #endif // #endif
id.value = option.id || ''; id.value = option.id || '';
name.value = option.name || ''; name.value = option.name || '';
template.value = option.template || '';
}); });
// //
@ -82,10 +85,11 @@
} else { } else {
getDiyInfo({ getDiyInfo({
id: id.value, id: id.value,
name: name.value name: name.value,
template: template.value
}).then((res : any) => { }).then((res : any) => {
if (res.data.value) { let data = res.data;
let data = res.data; if (data.value) {
diyData.pageMode = data.mode; diyData.pageMode = data.mode;
diyData.title = data.title; diyData.title = data.title;
@ -104,15 +108,19 @@
}); });
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: diyData.title title: diyData.title
}) });
loading.value = false;
let share = res.data.share ? JSON.parse(res.data.share) : null;
setShare(share);
} else if (data.mode == 'other') {
//
redirect({ url: data.page })
} }
let share = res.data.share ? JSON.parse(res.data.share) : null;
setShare(share);
loading.value = false;
}); });
} }
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -26,10 +26,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue'; import { ref, reactive, computed } from 'vue';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { getDiyInfo } from '@/api/diy'; import { getDiyInfo } from '@/app/api/diy';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/app/stores/diy';
import { useShare } from '@/hooks/useShare' import { useShare } from '@/hooks/useShare'
import { img } from '@/utils/common'; import { img, redirect } from '@/utils/common';
const { setShare, onShareAppMessage, onShareTimeline } = useShare() const { setShare, onShareAppMessage, onShareTimeline } = useShare()
setShare(); setShare();
@ -39,6 +39,8 @@
const loading = ref(true); const loading = ref(true);
const diyStore = useDiyStore(); const diyStore = useDiyStore();
const pullDownRefresh = ref(0) const pullDownRefresh = ref(0)
const name = ref('DIY_INDEX')
const template = ref('')
// //
const diyData = reactive({ const diyData = reactive({
@ -64,6 +66,7 @@
loading.value = false; loading.value = false;
} }
// #endif // #endif
template.value = option.template || '';
}); });
// //
@ -78,10 +81,11 @@
diyStore.init(); diyStore.init();
} else { } else {
getDiyInfo({ getDiyInfo({
name: 'DIY_INDEX' name: name.value,
template: template.value
}).then((res : any) => { }).then((res : any) => {
if (res.data.value) { let data = res.data;
let data = res.data; if (data.value) {
diyData.pageMode = data.mode; diyData.pageMode = data.mode;
diyData.title = data.title; diyData.title = data.title;
@ -100,10 +104,13 @@
}); });
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: diyData.title title: diyData.title
}) });
loading.value = false;
} else if (data.mode == 'other') {
//
redirect({ url: data.page })
} }
loading.value = false;
}); });
} }

View File

@ -15,7 +15,7 @@
<view v-else class="text-sm text-gray-subtitle mt-[10rpx]">{{ item.account_no }}</view> <view v-else class="text-sm text-gray-subtitle mt-[10rpx]">{{ item.account_no }}</view>
</view> </view>
</view> </view>
<view class="p-[30rpx] bg-white mx-[32rpx] my-[20rpx] rounded flex" @click="redirect({ url: '/pages/member/account_edit', param: { type: accountType, mode } })"> <view class="p-[30rpx] bg-white mx-[32rpx] my-[20rpx] rounded flex" @click="redirect({ url: '/app/pages/member/account_edit', param: { type: accountType, mode } })">
<u-icon name="plus" color="#333" size="16"></u-icon> <u-icon name="plus" color="#333" size="16"></u-icon>
<text class="text-sm ml-[10rpx] flex-1">{{ accountType == 'bank' ? t('addBankCard') : t('addAlipayAccount') }}</text> <text class="text-sm ml-[10rpx] flex-1">{{ accountType == 'bank' ? t('addBankCard') : t('addAlipayAccount') }}</text>
<u-icon name="arrow-right" color="#333" size="14"></u-icon> <u-icon name="arrow-right" color="#333" size="14"></u-icon>
@ -27,7 +27,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import { redirect } from '@/utils/common' import { redirect } from '@/utils/common'
import { getCashoutAccountList } from '@/api/member' import { getCashoutAccountList } from '@/app/api/member'
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue' import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue'
import useMescroll from '@/components/mescroll/hooks/useMescroll.js' import useMescroll from '@/components/mescroll/hooks/useMescroll.js'
import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app' import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app'
@ -69,8 +69,8 @@
} }
const handleClick = (data: AnyObject) => { const handleClick = (data: AnyObject) => {
if (mode.value == 'get') redirect({ url: '/pages/member/account_edit', param: { id: data.account_id, type: accountType.value, mode: mode.value } }) if (mode.value == 'get') redirect({ url: '/app/pages/member/account_edit', param: { id: data.account_id, type: accountType.value, mode: mode.value } })
else redirect({ url: '/pages/member/apply_cash_out', param: { account_id: data.account_id, type: accountType.value } }) else redirect({ url: '/app/pages/member/apply_cash_out', param: { account_id: data.account_id, type: accountType.value } })
} }
</script> </script>

View File

@ -72,7 +72,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, reactive } from 'vue' import { ref, computed, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { getCashoutAccountInfo, addCashoutAccount, editCashoutAccount, deleteCashoutAccount } from '@/api/member' import { getCashoutAccountInfo, addCashoutAccount, editCashoutAccount, deleteCashoutAccount } from '@/app/api/member'
import { t } from '@/locale' import { t } from '@/locale'
import { redirect } from '@/utils/common' import { redirect } from '@/utils/common'
@ -135,8 +135,8 @@
loading.value = true loading.value = true
save(formData).then((res) => { save(formData).then((res) => {
if (mode.value == 'get') redirect({ url: '/pages/member/account', param: { type: formData.account_type, mode: mode.value } }) if (mode.value == 'get') redirect({ url: '/app/pages/member/account', param: { type: formData.account_type, mode: mode.value } })
else redirect({ url: '/pages/member/apply_cash_out', param: { account_id: res.data, type: formData.account_type } }) else redirect({ url: '/app/pages/member/apply_cash_out', param: { account_id: res.data, type: formData.account_type } })
}).catch(() => { }).catch(() => {
loading.value = false loading.value = false
}) })
@ -145,7 +145,7 @@
const handleDelete = () => { const handleDelete = () => {
deleteCashoutAccount(formData.account_id).then(() => { deleteCashoutAccount(formData.account_id).then(() => {
redirect({ url: '/pages/member/account', mode: 'redirectTo' }) redirect({ url: '/app/pages/member/account', mode: 'redirectTo' })
}) })
} }
</script> </script>

View File

@ -46,7 +46,7 @@
<view>{{ t('cashOutToAlipay') }}</view> <view>{{ t('cashOutToAlipay') }}</view>
<view class="text-[#bbb] text-[26rpx] mt-[16rpx]"> <view class="text-[#bbb] text-[26rpx] mt-[16rpx]">
<view v-if="alipayAccountInfo"> <view v-if="alipayAccountInfo">
{{ t('cashOutTo') }}{{ t('alipayAccountNo') }}{{ alipayAccountInfo.account_no }} <text class="text-black" @click="redirect({ url: '/pages/member/account', param: { type: 'alipay', mode: 'select' } })">{{ t('replace') }}</text> {{ t('cashOutTo') }}{{ t('alipayAccountNo') }}{{ alipayAccountInfo.account_no }} <text class="text-black" @click="redirect({ url: '/app/pages/member/account', param: { type: 'alipay', mode: 'select' } })">{{ t('replace') }}</text>
</view> </view>
<view v-else> <view v-else>
{{ t('cashOutToAlipayTips') }} {{ t('cashOutToAlipayTips') }}
@ -54,7 +54,7 @@
</view> </view>
</view> </view>
<view class="flex items-center"> <view class="flex items-center">
<u-button :plain="true" type="primary" shape="circle" :custom-style="{height: '56rpx'}" v-if="!alipayAccountInfo" @click="redirect({ url: '/pages/member/account', param: { type: 'alipay', mode: 'select' } })">{{ t('toAdd') }}</u-button> <u-button :plain="true" type="primary" shape="circle" :custom-style="{height: '56rpx'}" v-if="!alipayAccountInfo" @click="redirect({ url: '/app/pages/member/account', param: { type: 'alipay', mode: 'select' } })">{{ t('toAdd') }}</u-button>
<view v-else @click="applyData.transfer_type = 'alipay'"> <view v-else @click="applyData.transfer_type = 'alipay'">
<text class="iconfont iconduigou text-[40rpx] text-primary" <text class="iconfont iconduigou text-[40rpx] text-primary"
v-if="applyData.transfer_type == 'alipay'"></text> v-if="applyData.transfer_type == 'alipay'"></text>
@ -75,7 +75,7 @@
<view>{{ t('cashOutToBank') }}</view> <view>{{ t('cashOutToBank') }}</view>
<view class="text-[#bbb] text-[26rpx] mt-[16rpx]"> <view class="text-[#bbb] text-[26rpx] mt-[16rpx]">
<view v-if="bankAccountInfo"> <view v-if="bankAccountInfo">
{{ t('cashOutTo') }}{{ bankAccountInfo.bank_name }}{{ t('debitCard') }}{{ bankAccountInfo.account_no.substring(bankAccountInfo.account_no.length - 4) }} <text class="text-black" @click="redirect({ url: '/pages/member/account', param: { type: 'bank', mode: 'select' } })">{{ t('replace') }}</text> {{ t('cashOutTo') }}{{ bankAccountInfo.bank_name }}{{ t('debitCard') }}{{ bankAccountInfo.account_no.substring(bankAccountInfo.account_no.length - 4) }} <text class="text-black" @click="redirect({ url: '/app/pages/member/account', param: { type: 'bank', mode: 'select' } })">{{ t('replace') }}</text>
</view> </view>
<view v-else> <view v-else>
{{ t('cashOutToBankTips') }} {{ t('cashOutToBankTips') }}
@ -83,7 +83,7 @@
</view> </view>
</view> </view>
<view class="flex items-center"> <view class="flex items-center">
<u-button :plain="true" type="primary" shape="circle" :custom-style="{height: '56rpx'}" v-if="!bankAccountInfo" @click="redirect({ url: '/pages/member/account', param: { type: 'bank', mode: 'select' } })">{{ t('toAdd') }}</u-button> <u-button :plain="true" type="primary" shape="circle" :custom-style="{height: '56rpx'}" v-if="!bankAccountInfo" @click="redirect({ url: '/app/pages/member/account', param: { type: 'bank', mode: 'select' } })">{{ t('toAdd') }}</u-button>
<view v-else @click="applyData.transfer_type = 'bank'"> <view v-else @click="applyData.transfer_type = 'bank'">
<text class="iconfont iconduigou text-[40rpx] text-primary" <text class="iconfont iconduigou text-[40rpx] text-primary"
v-if="applyData.transfer_type == 'bank'"></text> v-if="applyData.transfer_type == 'bank'"></text>
@ -100,7 +100,7 @@
@click="cashOut"></u-button> @click="cashOut"></u-button>
</view> </view>
<view class="mt-[40rpx] text-center text-sm" @click="redirect({ url: '/pages/member/cash_out'})"> <view class="mt-[40rpx] text-center text-sm" @click="redirect({ url: '/app/pages/member/cash_out'})">
{{t('cashOutList')}} {{t('cashOutList')}}
</view> </view>
</view> </view>
@ -113,7 +113,7 @@
import { t } from '@/locale' import { t } from '@/locale'
import { moneyFormat, redirect, img } from '@/utils/common' import { moneyFormat, redirect, img } from '@/utils/common'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import { cashOutConfig, cashOutApply, getFirstCashoutAccountInfo, getCashoutAccountInfo } from '@/api/member' import { cashOutConfig, cashOutApply, getFirstCashoutAccountInfo, getCashoutAccountInfo } from '@/app/api/member'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
const pageLoading = ref(true) const pageLoading = ref(true)
@ -188,7 +188,7 @@
// //
const allMoney = () => { const allMoney = () => {
applyData.apply_money = moneyFormat(cashOutMoney) applyData.apply_money = moneyFormat(cashOutMoney.value)
} }
// //
@ -265,7 +265,7 @@
cashOutApply(applyData) cashOutApply(applyData)
.then(res => { .then(res => {
redirect({ url: '/pages/member/cash_out' }) redirect({ url: '/app/pages/member/cash_out' })
}) })
.catch(() => { .catch(() => {
loading.value = false loading.value = false

View File

@ -11,14 +11,14 @@
<view class="text">{{t('accountBalance')}}</view> <view class="text">{{t('accountBalance')}}</view>
<view class="money-wrap"> <view class="money-wrap">
<view class="money-item" <view class="money-item"
@click="redirect({ url: '/pages/member/detailed_account', param: { type : 'balance' } })"> @click="redirect({ url: '/app/pages/member/detailed_account', param: { type : 'balance' } })">
<view class="money"> <view class="money">
{{ moneyFormat(memberStore.info?.balance)|| '0.00' }} {{ moneyFormat(memberStore.info?.balance)|| '0.00' }}
</view> </view>
<view class="text leading-none">{{ t('balance') }}</view> <view class="text leading-none">{{ t('balance') }}</view>
</view> </view>
<view class="money-item" <view class="money-item"
@click="redirect({ url: '/pages/member/detailed_account', param: { type : 'money' } })"> @click="redirect({ url: '/app/pages/member/detailed_account', param: { type : 'money' } })">
<view class="money"> <view class="money">
{{ moneyFormat(memberStore.info?.money)|| '0.00' }} {{ moneyFormat(memberStore.info?.money)|| '0.00' }}
</view> </view>
@ -29,44 +29,21 @@
</view> </view>
<view class="account-info-btn"> <view class="account-info-btn">
<u-button type="primary" shape="circle" class="btn" <!-- <u-button type="primary" shape="circle" class="btn"
:customStyle="{backgroundColor: '#FE4E50',color: '#fff', borderColor: '#FE4E50',width: 'calc(100vw - 64rpx)'}" :customStyle="{backgroundColor: '#FE4E50',color: '#fff', borderColor: '#FE4E50',width: 'calc(100vw - 64rpx)'}"
@click="topUpFn"> @click="topUpFn">
<img class="max-w-[36rpx] max-h-[36rpx] mr-1" :src="img('static/resource/images/member/reset.png')" <image class="max-w-[36rpx] max-h-[36rpx] mr-1" :src="img('static/resource/images/member/reset.png')"/>
alt="">
<text>{{t('recharge')}}</text> <text>{{t('recharge')}}</text>
</u-button> </u-button> -->
<u-button v-if="cashOutConfigObj.is_open == 1" type="primary" :plain="true" shape="circle" class="btn" <u-button v-if="cashOutConfigObj.is_open == 1" type="primary" :plain="true" shape="circle" class="btn"
:customStyle="{backgroundColor: '#fff',color: '#FE4E50', borderColor: '#FE4E50',width: 'calc(100vw - 64rpx)'}" :customStyle="{backgroundColor: '#fff',color: '#FE4E50', borderColor: '#FE4E50',width: 'calc(100vw - 64rpx)'}"
@click="applyCashOut"> @click="applyCashOut">
<img class="max-w-[36rpx] max-h-[36rpx] mr-1" <image class="max-w-[36rpx] max-h-[36rpx] mr-1"
:src="img('static/resource/images/member/withdraw_deposit.png')" alt=""> :src="img('static/resource/images/member/withdraw_deposit.png')" />
<text>{{t('cashOut')}}</text> <text>{{t('cashOut')}}</text>
</u-button> </u-button>
</view> </view>
<!-- 充值 -->
<u-popup :show="topUpShow" mode="center" :round="10" @close="closePopup" :closeable="true">
<view class="w-80 px-3 pb-4 pt-7 box-border">
<u--input :placeholder="t('rechargeAmountPlaceholder')" v-model="rechargeAmount" border="bottom"
type="number" clearable>
</u--input>
<view class="top-up-wrap flex flex-wrap justify-around mt-3">
<view v-for="(item,index) in rechargePackage" :key="index"
:class="['top-up-item w-22 box-border border-1 text-center rounded mt-2 py-3 px-4 border-gray-400 border-solid',{'border-primary text-primary':rechargeAmount == item}]"
@click="rechargeAmount = item">
<text>{{item}}{{t('yuan')}}</text>
</view>
</view>
<view class="mt-5 px-2">
<u-button type="primary" shape="circle" :loading="rechargeLoading" :text="t('clickRecharge')"
@click="recharge"></u-button>
</view>
<view class="mt-[20rpx] text-center text-sm"
@click="redirect({ url: '/pages/member/recharge_record' })">{{t('rechargeRecord')}}</view>
</view>
</u-popup>
<pay ref="payRef" @close="rechargeLoading = false"></pay> <pay ref="payRef" @close="rechargeLoading = false"></pay>
</view> </view>
</template> </template>
@ -75,24 +52,12 @@
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { t } from '@/locale' import { t } from '@/locale'
import { moneyFormat, redirect, img } from '@/utils/common'; import { moneyFormat, redirect, img } from '@/utils/common';
import { createRecharge, cashOutConfig } from '@/api/member'; import { cashOutConfig } from '@/app/api/member';
import { onShow } from '@dcloudio/uni-app'; import { onShow } from '@dcloudio/uni-app';
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
const memberStore = useMemberStore(), const memberStore = useMemberStore();
topUpShow = ref<boolean>(false);
const topUpFn = () => {
topUpShow.value = true;
}
const closePopup = () => {
topUpShow.value = false;
}
const rechargePackage = ref([20, 30, 50, 100, 200, 300])
const rechargeAmount = ref<string | number>("");
const rechargeLoading = ref(false) const rechargeLoading = ref(false)
const payRef = ref(null) const payRef = ref(null)
@ -122,34 +87,12 @@
}) })
}) })
/**
* 发起充值
*/
const recharge = () => {
if (uni.$u.test.isEmpty(rechargeAmount.value)) {
uni.showToast({ title: t('rechargeAmountPlaceholder'), icon: 'none' })
return
}
if (!uni.$u.test.amount(rechargeAmount.value) || rechargeAmount.value <= 0) {
uni.showToast({ title: t('rechargeAmountError'), icon: 'none' })
return
}
if (rechargeLoading.value) return
rechargeLoading.value = true
createRecharge({ recharge_money: rechargeAmount.value }).then(res => {
payRef.value?.open(res.data.trade_type, res.data.trade_id)
}).catch(() => {
rechargeLoading.value = false
})
}
const applyCashOut = () => { const applyCashOut = () => {
uni.setStorageSync('cashOutAccountType', 'money') uni.setStorageSync('cashOutAccountType', 'money')
redirect({ url: '/pages/member/apply_cash_out' }) redirect({ url: '/app/pages/member/apply_cash_out' })
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/account_info.scss'; @import '@/app/styles/account_info.scss';
</style> </style>

View File

@ -21,7 +21,7 @@
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import { t } from '@/locale' import { t } from '@/locale'
import { redirect, img } from '@/utils/common'; import { redirect, img } from '@/utils/common';
import { getCashOutList } from '@/api/member'; import { getCashOutList } from '@/app/api/member';
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue'; import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue'; import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js'; import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
@ -67,10 +67,10 @@ const getCashOutListFn = (mescroll)=>{
} }
const toDetailFn = (data)=>{ const toDetailFn = (data)=>{
redirect({ url: '/pages/member/cash_out_detail', param: { id: data.id }}); redirect({ url: '/app/pages/member/cash_out_detail', param: { id: data.id }});
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/styles/member_record_list.scss'; @import '@/app/styles/member_record_list.scss';
</style> </style>

View File

@ -51,7 +51,7 @@ import { reactive, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { t } from '@/locale' import { t } from '@/locale'
import { redirect, img } from '@/utils/common'; import { redirect, img } from '@/utils/common';
import { getCashOutDetail } from '@/api/member'; import { getCashOutDetail } from '@/app/api/member';
let cashOutInfo = ref({}); let cashOutInfo = ref({});
let loading = ref<boolean>(false); let loading = ref<boolean>(false);
@ -73,5 +73,5 @@ const getCashoutAccountListFn = (id) => {
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/styles/member_record_detail.scss'; @import '@/app/styles/member_record_detail.scss';
</style> </style>

View File

@ -5,10 +5,10 @@
:style="{ background: 'url(' + img('static/resource/images/member/balance_bg.png') + ') no-repeat 95% 30% / auto 250rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)'}"> :style="{ background: 'url(' + img('static/resource/images/member/balance_bg.png') + ') no-repeat 95% 30% / auto 250rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)'}">
<view class="name">{{t('commissionInfo')}}</view> <view class="name">{{t('commissionInfo')}}</view>
<view class="content"> <view class="content">
<view class="money" @click="redirect({ url: '/pages/member/detailed_account', param: { type : 'commission' } })"> <view class="money" @click="redirect({ url: '/app/pages/member/detailed_account', param: { type : 'commission' } })">
{{ memberStore.info ? moneyFormat(memberStore.info.commission) : 0.00 }} {{ memberStore.info ? moneyFormat(memberStore.info.commission) : 0.00 }}
</view> </view>
<view class="text" @click="redirect({ url: '/pages/member/detailed_account', param: { type : 'commission' } })">{{t('accountCommission')}}</view> <view class="text" @click="redirect({ url: '/app/pages/member/detailed_account', param: { type : 'commission' } })">{{t('accountCommission')}}</view>
<view class="money-wrap"> <view class="money-wrap">
<view class="money-item"> <view class="money-item">
<view class="money"> <view class="money">
@ -30,7 +30,7 @@
<u-button type="primary" :plain="true" shape="circle" class="btn" <u-button type="primary" :plain="true" shape="circle" class="btn"
:customStyle="{backgroundColor: '#fff',color: '#FE4E50', borderColor: '#FE4E50',width: 'calc(100vw - 64rpx)'}" :customStyle="{backgroundColor: '#fff',color: '#FE4E50', borderColor: '#FE4E50',width: 'calc(100vw - 64rpx)'}"
@click="applyCashOut"> @click="applyCashOut">
<img class="max-w-[36rpx] max-h-[36rpx] mr-1" :src="img('static/resource/images/member/withdraw_deposit.png')" alt=""> <image class="max-w-[36rpx] max-h-[36rpx] mr-1" :src="img('static/resource/images/member/withdraw_deposit.png')" />
<text>{{t('cashOut')}}</text> <text>{{t('cashOut')}}</text>
</u-button> </u-button>
</view> </view>
@ -44,10 +44,10 @@
const memberStore = useMemberStore(); const memberStore = useMemberStore();
const applyCashOut = ()=> { const applyCashOut = ()=> {
uni.setStorageSync('cashOutAccountType', 'commission') uni.setStorageSync('cashOutAccountType', 'commission')
redirect({ url: '/pages/member/apply_cash_out' }) redirect({ url: '/app/pages/member/apply_cash_out' })
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/styles/account_info.scss'; @import '@/app/styles/account_info.scss';
</style> </style>

View File

@ -20,7 +20,7 @@
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue'; import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue'; import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js'; import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
import { getBalanceList, getMoneyList, getCommissionList} from '@/api/member'; import { getBalanceList, getMoneyList, getCommissionList} from '@/app/api/member';
import { onPageScroll, onReachBottom, onLoad, onShow } from '@dcloudio/uni-app'; import { onPageScroll, onReachBottom, onLoad, onShow } from '@dcloudio/uni-app';
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom); const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom);
@ -79,5 +79,5 @@
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/styles/member_record_list.scss'; @import '@/app/styles/member_record_list.scss';
</style> </style>

View File

@ -26,15 +26,17 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed } from 'vue' import { ref, reactive, computed } from 'vue'
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app' import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'
import { getDiyInfo } from '@/api/diy' import { getDiyInfo } from '@/app/api/diy'
import useDiyStore from '@/stores/diy' import useDiyStore from '@/app/stores/diy'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import { img } from '@/utils/common'; import { img, redirect } from '@/utils/common';
const loading = ref(true); const loading = ref(true);
const diyStore = useDiyStore(); const diyStore = useDiyStore();
const pullDownRefresh = ref(0) const pullDownRefresh = ref(0)
const name = ref('DIY_MEMBER_INDEX')
//
const diyData = reactive({ const diyData = reactive({
pageMode: 'diy', pageMode: 'diy',
title: '', title: '',
@ -72,10 +74,10 @@
diyStore.init(); diyStore.init();
} else { } else {
getDiyInfo({ getDiyInfo({
name: 'DIY_MEMBER_INDEX' name: name.value
}).then((res : any) => { }).then((res : any) => {
if (res.data.value) { let data = res.data;
let data = res.data; if (data.value) {
diyData.pageMode = data.mode; diyData.pageMode = data.mode;
diyData.title = data.title; diyData.title = data.title;
@ -94,9 +96,12 @@
}); });
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: diyData.title title: diyData.title
}) });
loading.value = false;
} else if (data.mode == 'other') {
//
redirect({ url: data.page })
} }
loading.value = false;
}); });
} }
useMemberStore().getMemberInfo() useMemberStore().getMemberInfo()

View File

@ -25,7 +25,7 @@
<template #value> <template #value>
<view v-if="info.mobile">{{ mobileConceal(info.mobile) }}</view> <view v-if="info.mobile">{{ mobileConceal(info.mobile) }}</view>
<view> <view>
<app-link url="/pages/auth/bind"> <app-link url="/app/pages/auth/bind">
<u-button type="primary" :plain="true" :text="t('bindMobile')" shape="circle" <u-button type="primary" :plain="true" :text="t('bindMobile')" shape="circle"
size="mini"></u-button> size="mini"></u-button>
</app-link> </app-link>
@ -67,8 +67,8 @@
import { t } from '@/locale' import { t } from '@/locale'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import { img, mobileConceal } from '@/utils/common' import { img, mobileConceal } from '@/utils/common'
import { modifyMember } from '@/api/member' import { modifyMember } from '@/app/api/member'
import { fetchBase64Image, uploadImage } from '@/api/system' import { fetchBase64Image, uploadImage } from '@/app/api/system'
const memberStore = useMemberStore() const memberStore = useMemberStore()
const info = computed(() => memberStore.info) const info = computed(() => memberStore.info)

View File

@ -16,7 +16,7 @@ import { reactive, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { t } from '@/locale' import { t } from '@/locale'
import { redirect, img } from '@/utils/common'; import { redirect, img } from '@/utils/common';
import { getPointList } from '@/api/member'; import { getPointList } from '@/app/api/member';
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue'; import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue'; import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js'; import useMescroll from '@/components/mescroll/hooks/useMescroll.js';

View File

@ -1,15 +1,15 @@
<template> <template>
<view class="w-screen h-screen flex flex-col items-center" v-if="payInfo"> <view class="w-screen bg-[#fff] flex flex-col items-center" v-if="payInfo">
<view class="flex-1 flex flex-col items-center w-full pt-[100rpx]"> <view class="flex-1 flex flex-col items-center w-full pt-[100rpx]">
<text class="iconfont text-2xl" <image v-if="payInfo.status==2" class="max-w-[144rpx] max-h-[88rpx]" :src="img('static/resource/images/result/pay_succeed.png')"/>
:class="payInfo.status==2 ? 'text-primary iconduigou' : 'iconzhifushibai text-red'"></text> <image v-else class="max-w-[144rpx] max-h-[88rpx]" :src="img('static/resource/images/result/pay_error.png')"/>
<view class=" text-sm">{{ payInfo.status == 2 ? t('pay.paySuccess') : t('pay.payFail') }}</view> <view class=" text-[32rpx] font-bold mt-[22rpx]">{{ payInfo.status == 2 ? t('pay.paySuccess') : t('pay.payFail') }}</view>
<view class="text-xl font-bold pt-[30rpx]"> <view class="text-[40rpx] font-bold mt-[40rpx] text-[#FF4646]">
<text class="text-base">{{ t('currency') }}</text> <text class="text-base">{{ t('currency') }}</text>
<text>{{ moneyFormat(payInfo.money) }}</text> <text>{{ moneyFormat(payInfo.money) }}</text>
</view> </view>
</view> </view>
<view class="pb-[200rpx] w-[240rpx]"> <view class="pb-[80rpx] pt-[40rpx] w-[240rpx]">
<u-button type="primary" :text="payInfo.status == 2 ? t('complete') : t('close')" <u-button type="primary" :text="payInfo.status == 2 ? t('complete') : t('close')"
:plain="true" @click="complete"></u-button> :plain="true" @click="complete"></u-button>
</view> </view>
@ -25,9 +25,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { getPayInfo as getPayInfoApi } from '@/api/pay' import { getPayInfo as getPayInfoApi } from '@/app/api/pay'
import { t } from '@/locale' import { t } from '@/locale'
import { redirect, moneyFormat } from '@/utils/common' import { redirect, img, moneyFormat } from '@/utils/common'
import { getFirstPage } from '@/utils/pages' import { getFirstPage } from '@/utils/pages'
const payInfo = ref<AnyObject | null>(null) const payInfo = ref<AnyObject | null>(null)
@ -69,8 +69,14 @@
} }
const complete = () => { const complete = () => {
redirect({ url: getFirstPage(), param: { code: payInfo.value?.out_trade_no }, mode: 'redirectTo' }) const payReturn = decodeURIComponent(uni.getStorageSync('payReturn'))
if (payReturn) redirect({ url: payReturn, mode: 'redirectTo' })
else redirect({ url: getFirstPage(), param: { code: payInfo.value?.out_trade_no }, mode: 'redirectTo' })
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
body{
background-color: #F7F7F7;
}
</style>

View File

@ -3,15 +3,15 @@
<view class="h-[30rpx]"></view> <view class="h-[30rpx]"></view>
<view class="m-[30rpx] bg-white rounded-md overflow-hidden px-[20rpx] py-[10rpx]"> <view class="m-[30rpx] bg-white rounded-md overflow-hidden px-[20rpx] py-[10rpx]">
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell :title="t('personalSettings')" :is-link="true" url="/pages/member/personal"></u-cell> <u-cell :title="t('personalSettings')" :is-link="true" url="/app/pages/member/personal"></u-cell>
<u-cell :title="t('switchLang')" :is-link="true" :value="lang" @click="langSheetShow = true"></u-cell> <u-cell :title="t('switchLang')" :is-link="true" :value="lang" @click="langSheetShow = true"></u-cell>
<u-cell :title="t('version')" :value="version"></u-cell> <u-cell :title="t('version')" :value="version"></u-cell>
</u-cell-group> </u-cell-group>
</view> </view>
<view class="m-[30rpx] bg-white rounded-md overflow-hidden px-[20rpx] py-[10rpx]"> <view class="m-[30rpx] bg-white rounded-md overflow-hidden px-[20rpx] py-[10rpx]">
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell :title="t('userAgreement')" :is-link="true" url="/pages/auth/agreement?key=service"></u-cell> <u-cell :title="t('userAgreement')" :is-link="true" url="/app/pages/auth/agreement?key=service"></u-cell>
<u-cell :title="t('privacyAgreement')" :is-link="true" url="/pages/auth/agreement?key=privacy"></u-cell> <u-cell :title="t('privacyAgreement')" :is-link="true" url="/app/pages/auth/agreement?key=privacy"></u-cell>
</u-cell-group> </u-cell-group>
</view> </view>
<!-- #ifdef H5 --> <!-- #ifdef H5 -->

View File

@ -9,6 +9,7 @@ interface Diy {
title : string, title : string,
pageBgColor : string, // 页面背景颜色 pageBgColor : string, // 页面背景颜色
bottomTabBarSwitch : boolean, // 底部导航开关 bottomTabBarSwitch : boolean, // 底部导航开关
bgUrl: string
}, },
// 组件集合 // 组件集合
value : any[] value : any[]

View File

@ -25,7 +25,7 @@
const toRedirect = () => { const toRedirect = () => {
if (Object.keys(prop.data).length) { if (Object.keys(prop.data).length) {
if (!prop.data.url) return; if (!prop.data.url) return;
if (currRoute() == 'pages/member/index' && !getToken()) { if (currRoute() == 'app/pages/member/index' && !getToken()) {
useLogin().setLoginBack({ url: prop.data.url }) useLogin().setLoginBack({ url: prop.data.url })
return; return;
} }

Some files were not shown because too many files have changed in this diff Show More