first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

43
App.vue Normal file
View File

@@ -0,0 +1,43 @@
<script>
import { Store } from '@/store';
export default {
onLaunch: async function (options) {
if (options && options.query) {
uni.setStorageSync('inviteCode', options.query.scene);
console.log('----',uni.getStorageSync('inviteCode'));
}
const store = Store();
await store.usersGetInfo();
},
onShow: function (options) {
uni.setStorageSync('inviteCode', options.query.scene);
console.log('App Show');
},
onHide: function () {
console.log('App Hide');
}
};
</script>
<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uni-scss/index.scss';
/* #ifndef APP-NVUE */
@import '@/static/customicons.css';
// 设置整个项目的背景色
@import '@/common/index.scss';
page {
background-color: #f5f5f5;
}
/* #endif */
.example-info {
font-size: 14px;
color: #333;
padding: 10px;
}
</style>

69
api/http.ts Normal file
View File

@@ -0,0 +1,69 @@
import { toast } from '@/utils/fun.js';
export const proxyObj = {
// 开发版
development: 'https://apidjk.jitujt.com',
// development: 'http://192.168.1.62:48080',
// development: 'http://192.168.1.191:48080',
// 正式版
production: 'https://apidjk.jitujt.com',
}
interface shortcutsType {
url : string
params : any
method : any
}
export const http = ({ url, params, method } : shortcutsType) => {
return new Promise((resolve, reject) => {
let Authorization : string = uni.getStorageSync('Authorization') || ''
let header = {
Authorization,
"Tenant-id": "134",
}
uni.request({
url: proxyObj[process.env.NODE_ENV || 'development'] + url,
data: params || {},
method: method || 'POST',
header: header,
success: (res : any) => {
const data = res.data
if (data.code == 401 || res.statusCode == 401) {
uni.removeStorageSync('Authorization');
uni.removeStorageSync('userInfo');
uni.showModal({
title: '提示',
content: `${Authorization ? '登录失效' : '你还未登录'},是否前往登录?`,
success: function (res) {
if (res.confirm) {
// uni.clearStorageSync();
uni.navigateTo({
url: '/pages/login/login'
})
} else if (res.cancel) {
uni.clearStorageSync();
console.log('用户点击取消');
}
}
});
reject(data)
return
}
if (data.code === 0) {
resolve(data.data || null)
} else {
toast(data.msg)
reject(data)
}
},
fail: (err) => {
reject(err)
}
})
});
};

13
api/index.ts Normal file
View File

@@ -0,0 +1,13 @@
import users from './modules/users'
import goods from './modules/goods'
import config from './modules/config'
import order from './modules/order'
// 公用接口申明
const api = {
// 用户相关接口
...users,
...goods,
...config,
...order
}
export default api

17
api/modules/config.ts Normal file
View File

@@ -0,0 +1,17 @@
import { http } from '../http'
// 用户相关接口
const api = {
// 轮播图列表
banner: (params = {}) => http({ url: '/app-api/djk/app/banner/page', params, method: 'GET' }),
// 公告列表
noticePage: (params = {}) => http({ url: '/app-api/djk/app/notice/page', params, method: 'GET' }),
// 公告分类
noticeCatePage: (params = {}) => http({ url: '/app-api/djk/app/notice-category/page', params, method: 'GET' }),
// 公告详情
noticeInfo: (params = {}) => http({ url: '/app-api/djk/app/notice/get', params, method: 'GET' }),
}
export default api

15
api/modules/goods.ts Normal file
View File

@@ -0,0 +1,15 @@
import { http } from '../http'
// 用户相关接口
const api = {
// 商品列表
goodsPage: (params = {}) => http({ url: '/app-api/djk/app/goods/page', params, method: 'GET' }),
// 商品详情
goodsInfo: (params = {}) => http({ url: '/app-api/djk/app/goods/get', params, method: 'GET' }),
// 商品分类
goodsCate: (params = {}) => http({ url: '/app-api/djk/app/goods/category/page', params, method: 'GET' }),
}
export default api

15
api/modules/order.ts Normal file
View File

@@ -0,0 +1,15 @@
import { http } from '../http'
// 用户相关接口
const api = {
// 创建用户订单
orderCreate: (params = {}) => http({ url: '/app-api/djk/app/order/create', params, method: 'POST' }),
// 用户订单列表
orderPage: (params = {}) => http({ url: '/app-api/djk/app/order/page', params, method: 'GET' }),
// 获取用户订单详情
orderInfo: (params = {}) => http({ url: '/app-api/djk/app/order/get', params, method: 'GET' }),
}
export default api

44
api/modules/users.ts Normal file
View File

@@ -0,0 +1,44 @@
import { http } from '../http'
// 用户相关接口
const api = {
// 密码登录
loginApi: (params = {}) => http({ url: '/app-api/member/auth/login', params, method: 'POST' }),
// 验证码登录
smsLoginApi: (params = {}) => http({ url: '/app-api/member/auth/sms-login', params, method: 'POST' }),
//用户注册
registerApi: (params = {}) => http({ url: '/app-api/member/auth/register', params, method: 'POST' }),
// 发送验证码
smsCode: (params = {}) => http({ url: '/app-api/member/auth/send-sms-code', params, method: 'POST' }),
// 用户基本信息
usersGetInfo: (params = {}) => http({ url: '/app-api/member/user/get', params, method: 'GET' }),
// 获取团队列表
usersGetInfoTeam: (params = {}) => http({ url: '/app-api/member/user/getPage', params, method: 'GET' }),
// 修改个人信息
usersUpdate: (params = {}) => http({ url: '/app-api/member/user/update', params, method: 'PUT' }),
// 收货地址分页
addressPage: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/page', params, method: 'GET' }),
// 新增收货地址
addressAdd: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/create', params, method: 'POST' }),
// 编辑收货地址
addressUp: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/update', params, method: 'PUT' }),
// 编辑收货地址
addressInfo: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/get', params, method: 'GET' }),
// 删除收货地址
addressDel: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/delete?id=' + params.id, params, method: 'DELETE' }),
// 余额记录
moneyRecord: (params = {}) => http({ url: '/app-api/member/money-record/djk/page', params, method: 'GET' }),
// 修改用户手机号
updateMobile: (params = {}) => http({ url: '/app-api/member/user/update-mobile', params, method: 'PUT' }),
// 报单综合
rewardReport: (params = {}) => http({ url: '/app-api/member/money-record/djk/rewardReport', params, method: 'GET' }),
// 团队月度业绩奖查询
getTeamMonthlyPerformanceAward: (params = {}) => http({ url: '/app-api/member/money-record/djk/getTeamMonthlyPerformanceAward', params, method: 'GET' }),
// 划转
transfer2other: (params = {}) => http({ url: '/app-api/member/user/pay/transfer2other', params, method: 'POST' }),
}
export default api

15
common/index.scss Normal file
View File

@@ -0,0 +1,15 @@
view,
image {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.mt30 {
margin-top: 30rpx;
}
.p30 {
padding: 30rpx;
}

37
common/js/user.js Normal file
View File

@@ -0,0 +1,37 @@
import {
getOssUploadParams
} from "@/api/api.js"
export const uploadFiles = (urls) => {
return new Promise(async (resolve, reject) => {
let res = await getOssUploadParams()
const fd = {
policy: res.policy,
OSSAccessKeyId: res.accessId,
success_action_status: 200,
signature: res.signature,
key: res.dir + Date.now() + Math.floor(100000 + Math.random() *
900000) + '.' +
urls.substring(urls.lastIndexOf(".") + 1),
};
uni.uploadFile({
url: res.host, // Example, not a real endpoint
filePath: urls,
header: {
"content-type": 'multipart/form-data'
},
name: 'file',
formData: fd,
success: (_res) => {
resolve(fd.key);
},
fail: (err) => {
console.log(err);
reject(err);
}
});
console.log();
});
}

105
common/money.json Normal file
View File

@@ -0,0 +1,105 @@
[{
"name": "充值",
"id": 1100
},
{
"name": "后台充值",
"id": 1200
},
{
"name": "后台划扣",
"id": 1201
},
{
"name": "购买商品",
"id": 2100
},
{
"name": "商品推广",
"id": 2110
},
{
"name": "商品培育津贴",
"id": 2120
},
{
"name": "商品服务津贴",
"id": 2130
},
{
"name": "购买商品-退单",
"id": 2200
},
{
"name": "商品推广-退单",
"id": 2210
},
{
"name": "商品培育津贴-退单",
"id": 2220
},
{
"name": "商品服务津贴-退单",
"id": 2230
},
{
"name": "充电桩收益",
"id": 3100
},
{
"name": "充电桩推广",
"id": 3110
},
{
"name": "充电桩培育津贴",
"id": 3120
},
{
"name": "充电桩服务津贴",
"id": 3130
},
{
"name": "充电桩收益-退单",
"id": 3200
},
{
"name": "充电桩推广-退单",
"id": 3210
},
{
"name": "充电桩培育津贴-退单",
"id": 3220
},
{
"name": "充电桩服务津贴-退单",
"id": 3230
},
{
"name": "提现",
"id": 4100
},
{
"name": "提现失败",
"id": 4200
},
{
"name": "转赠付款",
"id": 5100
},
{
"name": "转赠收款",
"id": 5200
},
{
"name": "转换减少",
"id": 6100
},
{
"name": "转换增加",
"id": 6200
},
{
"name": "转账-星梦",
"id": 7100
}
]

54
hooks/useNav.js Normal file
View File

@@ -0,0 +1,54 @@
import {
ref,
watch
} from 'vue';
import {
Store
} from '@/store';
const store = Store();
export function useNav() {
const navTo = (path, token, call) => {
if (call) {
uni.makePhoneCall({
phoneNumber: '17707569278'
});
return
}
const Authorization = uni.getStorageSync('Authorization') || ''
if (token && !Authorization) {
return uni.showModal({
title: '提示',
content: '你还未登录,是否前往登录?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
uni.navigateTo({
url: path
})
}
}
const nav = (e) => {
uni[e.type == 'nav' || !e.type ? 'navigateTo' : e.type == 'switchTab' ? 'switchTab' : 'navigateTo']({
url: e.path
})
}
return {
nav,
navTo
}
}
export default useNav

20
index.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

37
main.js Normal file
View File

@@ -0,0 +1,37 @@
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
import share from "./utils/mpShare.js";
Vue.mixin(share)
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
import App from './App.vue'
import * as Pinia from 'pinia'
import share from "./utils/mpShare.js";
export function createApp() {
const app = createSSRApp(App)
app.mixin(share)
app.use(Pinia.createPinia())
return {
app
}
}
// #endif

60
manifest.json Normal file
View File

@@ -0,0 +1,60 @@
{
"name" : "dajiankuang",
"appid" : "__UNI__C20A99C",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
/* 5+App */
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"nvueStyleCompiler" : "uni-app",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {},
/* */
"distribute" : {
/* */
"android" : {
/* android */
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios" : {},
/* ios */
"sdkConfigs" : {}
}
},
/* SDK */
"quickapp" : {},
/* */
"mp-weixin" : {
/* */
"appid" : "wx80532d1eec915730",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"vueVersion" : "3"
}

187
pages.json Normal file
View File

@@ -0,0 +1,187 @@
{
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
},
{
"path": "pages/mine/mine",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/cate/cate",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#799675"
}
},
{
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/goods/goods",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/team/team",
"style": {
"navigationBarTitleText": "我的团队"
}
},
{
"path": "pages/mine/sett",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/equity/equity",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/wallet/wallet",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/notice/notice",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/address/list",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/address/add",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/order/confirm",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/order/success",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/goods/prefecture",
"style": {
"navigationBarTitleText": "进货专区",
"navigationStyle": "custom"
}
},
{
"path": "pages/wallet/list",
"style": {
"navigationBarTitleText": "我的账单",
"navigationStyle": "custom"
}
},
{
"path": "pages/notice/details",
"style": {
"navigationBarTitleText": "公告",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/mine/mobile",
"style": {
"navigationBarTitleText": "修改手机号",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path" : "pages/protocol/protocol",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/wallet/zhaun",
"style" :
{
"navigationBarTitleText" : "余额划转"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"app-plus": {
"background": "#efeff4"
}
},
"tabBar": {
"color": "#AAA",
"selectedColor": "#516E41",
"borderStyle": "black",
"backgroundColor": "#ffffff",
// "height": "60px",
"fontSize": "16px",
"list": [{
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/homes.png",
"pagePath": "pages/index/index",
"text": "首页"
}, {
"iconPath": "static/tabbar/cate.png",
"selectedIconPath": "static/tabbar/cates.png",
"pagePath": "pages/cate/cate",
"text": "分类"
}, {
"iconPath": "static/tabbar/order.png",
"selectedIconPath": "static/tabbar/orders.png",
"pagePath": "pages/order/order",
"text": "订单"
}, {
"iconPath": "static/tabbar/mine.png",
"selectedIconPath": "static/tabbar/mines.png",
"pagePath": "pages/mine/mine",
"text": "我的"
}]
}
}

252
pages/address/add.vue Normal file
View File

@@ -0,0 +1,252 @@
<template>
<view class="address-add">
<wd-navbar title="新增地址" safeAreaInsetTop left-arrow @click-left="back"></wd-navbar>
<view class="from-address">
<view class="title">收货人</view>
<view class="content">
<wd-input type="text" no-border v-model="from.receiverName" placeholder="请输入收货人姓名" />
</view>
</view>
<view class="from-address">
<view class="title">手机号</view>
<view class="content">
<wd-input type="number" no-border v-model="from.receiverPhone" placeholder="请输入手机号" />
</view>
</view>
<view class="from-address">
<view class="title">所在地区</view>
<view class="content">
<wd-input type="text" no-border v-model="from.receiverArea" placeholder="请输入省市区" />
</view>
</view>
<view class="from-address">
<view class="title">详细地址</view>
<view class="content">
<wd-input type="text" no-border v-model="from.receiverAddress" placeholder="请输入详细地址" />
</view>
</view>
<view class="from-address" style="margin-top: 30rpx; justify-content: space-between">
<view class="title" style="width: 300rpx">设置为默认地址</view>
<view>
<wd-switch v-model="from.isDefault" size="20px" />
<!-- <up-switch v-model="from.is_default" size="20" activeColor="#7ADE77" :activeValue="1" :inactiveValue="0"></up-switch> -->
</view>
</view>
<view class="bottom-btn">
<view class="button-a" @click="add_Address">保存</view>
</view>
</view>
</template>
<script setup lang="ts">
import api from '@/api/index';
import { ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
onLoad((options) => {
if(options.id){
api.addressInfo({ id: options.id }).then((res) => {
// 1. 处理接口返回数据(假设有效数据在 res.data 中)
const resData = res || {}; // 避免空数据报错
resData.isDefault = resData.isDefault ? true : false;
// 2. 筛选:只取 from 中已有的字段
const formKeys = Object.keys(from.value); // from 的所有键(如 receiverName、receiverPhone 等)
const updateData = {};
formKeys.forEach((key) => {
if (resData.hasOwnProperty(key)) {
// 仅当接口数据有该字段时才取
updateData[key] = resData[key];
}
});
// 3. 合并到 from.value覆盖已有字段保留默认值
Object.assign(from.value, updateData);
});
}
});
const from = ref({
receiverName: '',
receiverPhone: '',
receiverArea: '',
receiverAddress: '',
isDefault: true,
status: 0,
id: ''
});
const add_Address = () => {
let data = JSON.parse(JSON.stringify(from.value));
data.isDefault = data.isDefault ? 1 : 0;
if(data.id){
api.addressUp(data).then((res) => {
uni.navigateBack();
});
}else{
api.addressAdd(data).then((res) => {
uni.navigateBack();
});
}
};
const back = () => {
uni.navigateBack();
};
// export default {
// data() {
// return {
// value: '',
// styles: {
// color: '#2979FF',
// borderColor: '#fff'
// },
// classes: '请选择',
// dataTree: [],
// from: {
// realName: '',
// phone: '',
// city: '',
// detail: '',
// is_default: 0
// },
// type: null
// };
// },
// onLoad(option) {
// if (option.type == 'edit') {
// this.type = option.type;
// this.$http
// .get_user_address_detail({
// address_id: option.id
// })
// .then((res) => {
// this.from.address_id = res.id;
// this.from.name = res.name;
// this.from.city = res.city;
// this.from.is_default = Number(res.is_default);
// this.from.phone = res.phone;
// this.from.address = res.address;
// console.log(res);
// });
// }
// },
// methods: {
// handleGetRegion(region) {
// this.from.city = region[0].name + '/' + region[1].name + '/' + region[2].name;
// console.log(region);
// },
// back() {
// uni.navigateBack();
// },
// from_mo(data) {
// console.log(data);
// this.from = {
// name: data.name,
// phone: data.phone,
// province: data.province,
// city: data.city,
// area: data.area,
// address: data.address,
// status: parseInt(data.status),
// code: data.code,
// address_id: data.id
// };
// },
// add_Address() {
// if (uni.$u.test.mobile(this.from.phone) != true) {
// uni.showToast({
// title: '手机号格式错误',
// icon: 'none'
// });
// return;
// }
// if (this.type == 'edit') {
// this.$http.edit_user_address(this.from).then((res) => {
// this.$http.show('保存成功');
// setTimeout(() => {
// uni.navigateBack();
// }, 2000);
// });
// } else {
// this.$http.add_user_address(this.from).then((res) => {
// this.$http.show('保存成功');
// // uni.$emit('Addaddress', e)
// setTimeout(() => {
// uni.navigateBack();
// }, 2000);
// });
// }
// },
// onchange(e) {
// const value = e.detail.value;
// this.from.province = value[0].text;
// this.from.city = value[1].text;
// this.from.area = value[2].text;
// this.from.code = value[2].value;
// },
// onnodeclick(node) {}
// }
// };
</script>
<style scoped lang="scss">
.address-add {
width: 100%;
padding: 00rpx 0 180rpx;
.from-address {
background-color: #fff;
height: 110rpx;
padding: 0rpx 20rpx;
display: flex;
align-items: center;
.title {
width: 150rpx;
font-size: 28rpx;
font-weight: bold;
color: #333333;
}
.content {
flex: 1;
height: 100rpx;
display: flex;
align-items: center;
border-bottom: 1rpx solid #f6f6f6;
}
}
.bottom-btn {
width: 100%;
height: 150rpx;
padding: 30rpx;
background-color: #ffffff;
position: fixed;
bottom: 0;
left: 0;
border-radius: 20rpx 20rpx 0 0;
box-shadow: 0px 6rpx 16rpx 2rpx rgba(170, 170, 170, 0.35);
display: flex;
align-items: center;
justify-content: center;
.button-a {
width: 690rpx;
height: 90rpx;
background: #799675;
border-radius: 15rpx;
text-align: center;
font-size: 30rpx;
color: #ffffff;
line-height: 90rpx;
}
}
}
</style>

267
pages/address/list.vue Normal file
View File

@@ -0,0 +1,267 @@
<template>
<view class="address">
<wd-navbar title="地址管理" safeAreaInsetTop left-arrow @click-left="back"></wd-navbar>
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="padding: 30rpx">
<view class="address-a" @click="back_A(item)" v-for="(item, index) in dataList" :key="index">
<view class="top">
<view class="top-a">
<view>{{ item.receiverName }}</view>
<view>{{ item.receiverPhone }}</view>
</view>
<view class="top-b">{{ item.receiverArea }} {{ item.receiverAddress }}</view>
</view>
<view class="bottom">
<view class="bottom-r">
<view @click.stop="deleAddress(item)">删除</view>
<view style="margin-left: 50rpx" @click.stop="tn(`./add?id=${item.id}`)">编辑</view>
<view @click.stop="copyAddress(item)" style="margin: 0 50rpx">复制</view>
</view>
</view>
</view>
</view>
</z-paging>
<view class="bottom-btn">
<view class="button-a" @click="tn('./add')">新增收货地址</view>
</view>
</view>
</template>
<script setup lang="ts">
import api from '@/api/index';
import { ref, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const paging = ref(null);
const type = ref(null);
const dataList = ref([]);
onLoad((options: any) => {
type.value = options.type;
});
onShow(() => {
paging.value.reload();
});
const queryList = (pageNo, pageSize) => {
api.addressPage({ pageNo, pageSize })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
const back = () => {
uni.navigateBack();
};
const tn = (e) => {
uni.navigateTo({
url: e
});
};
const back_A = (e) => {
if (type.value == 1) {
uni.$emit('address', e);
uni.navigateBack();
} else {
return;
}
};
const deleAddress = (data) => {
uni.showModal({
title: '提示',
content: '是否确认删除?',
success: (res) => {
if (res.confirm) {
api.addressDel({ id: data.id }).then((res) => {
paging.value.reload();
});
}
}
});
};
const copyAddress = (data) => {
let aaa = `收货人:${data.receiverName}
手机号码:${data.receiverPhone}
所在地区:${data.receiverArea}
详细地址:${data.receiverAddress}`;
uni.setClipboardData({
data: aaa,
success: function () {
console.log('success');
}
});
};
// export default {
// data() {
// return {
// list: [],
// type: null
// };
// },
// onLoad(option) {
// this.type = option.type;
// this.getList();
// },
// methods: {
// getList() {
// // addressList().then((res) => {
// // this.list = res;
// // });
// },
// copyAddress(data) {
// let aaa = `收货人:${data.realName}
// 手机号码:${data.phone}
// 所在地区:${data.province}${data.city}${data.district}
// 详细地址:${data.detail}`;
// uni.setClipboardData({
// data: aaa,
// success: function () {
// console.log('success');
// }
// });
// },
// back_A(e) {
// if (this.type == 1) {
// uni.$emit('address', e);
// uni.navigateBack();
// } else {
// return;
// }
// },
// deleAddress(data) {
// uni.showModal({
// title: '提示',
// content: '是否确认删除?',
// success: (res) => {
// if (res.confirm) {
// addressDel({ id: data.id }).then((res) => {
// this.getList();
// });
// }
// }
// });
// },
// tn(e) {
// wx.chooseAddress({
// success: (res) => {
// addressSave({
// realName: res.userName,
// phone: res.telNumber,
// province: res.provinceName,
// city: res.cityName,
// district: res.countyName,
// detail: res.detailInfo
// }).then((res) => {
// this.getList();
// });
// console.log(res);
// },
// fail: (err) => {
// console.log(err);
// }
// });
// }
// }
// };
</script>
<style lang="scss" scoped>
.address {
.address-a {
width: 100%;
background: #ffffff;
box-shadow: 0px 2rpx 21rpx 0px rgba(184, 184, 184, 0.35);
border-radius: 17rpx;
margin-bottom: 30rpx;
.top {
padding: 40rpx;
border-bottom: 1rpx solid #f3f3f3;
.top-a {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
font-weight: bold;
color: #222222;
margin-bottom: 45rpx;
}
.top-b {
font-size: 30rpx;
font-weight: bold;
color: #999999;
}
}
.bottom {
padding: 35rpx;
display: flex;
align-items: center;
justify-content: space-between;
.bottom-che {
display: flex;
align-items: center;
image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
font-size: 24rpx;
font-weight: bold;
color: #222222;
}
.bottom-r {
font-size: 26rpx;
font-weight: bold;
color: #999999;
display: flex;
align-items: center;
}
}
}
.bottom-btn {
width: 100%;
height: 150rpx;
padding: 30rpx;
background-color: #ffffff;
position: fixed;
bottom: 0;
left: 0;
border-radius: 20rpx 20rpx 0 0;
box-shadow: 0px 6rpx 16rpx 2rpx rgba(170, 170, 170, 0.35);
display: flex;
align-items: center;
justify-content: center;
.button-a {
width: 690rpx;
height: 90rpx;
background: #799675;
border-radius: 15rpx;
text-align: center;
font-size: 30rpx;
color: #ffffff;
line-height: 90rpx;
}
}
}
</style>

290
pages/cate/cate.vue Normal file
View File

@@ -0,0 +1,290 @@
<template>
<view class="u-wrap">
<wd-search @search="search" @clear="clear" placeholder-left placeholder="搜一搜药品名称" hide-cancel :customStyle="{ background: '#799675', height: '80rpx' }" />
<view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view">
<view
v-for="(item, index) in goodsCate"
:key="index"
class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']"
:data-current="index"
@tap.stop="swichMenu(index, item.id)"
>
<text class="u-line-1">{{ item.name }}</text>
</view>
</scroll-view>
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList" :paging-style="{ 'background-color': '#FFF' }">
<view class="right-box">
<view class="page-view">
<view class="page-view_item" v-for="(item, index) in dataList" :key="index" @click="toGoods(item.id)">
<image :src="item.cover" mode="aspectFill"></image>
<view style="flex: 1">
<view class="page-view_item_title">{{ item.name }}</view>
<view class="page-view_item_info">{{ item.specs }}</view>
<view class="page-view_item_price">
<view class="page-view_item_price_left">{{ item.currentPrice }}</view>
<view class="page-view_item_price_right">{{ item.originalPrice }}</view>
</view>
</view>
</view>
</view>
</view>
</z-paging>
<!--
<scroll-view scroll-y class="right-box">
<view class="page-view">
<view class="page-view_item" v-for="(item, index) in goodsList" :key="index" @click="toGoods(item.id)">
<image :src="item.cover" mode="aspectFill"></image>
<view style="flex: 1">
<view class="page-view_item_title">{{ item.name }}</view>
<view class="page-view_item_info">{{ item.specs }}</view>
<view class="page-view_item_price">
<view class="page-view_item_price_left">{{ item.originalPrice }}</view>
<view class="page-view_item_price_right">{{ item.currentPrice }}</view>
</view>
</view>
</view>
</view>
</scroll-view> -->
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import api from '@/api/index';
const current = ref<number>(0);
const goodsCate = ref([]);
const goodsList = ref([]);
const paging = ref(null);
const dataList = ref([]);
const goodsCateId = ref(null);
const name = ref('');
// interface goodsCateType {
// list: Array;
// total: number;
// }
onLoad(() => {
api.goodsCate().then((res: any) => {
goodsCate.value = res.list;
goodsCateId.value = res.list[0].id;
});
});
const queryList = (pageNo, pageSize) => {
if (!goodsCateId.value) {
api.goodsCate().then((res: any) => {
goodsCate.value = res.list;
goodsCateId.value = res.list[0].id;
api.goodsPage({ pageNo, pageSize, categoryId: goodsCateId.value, name: name.value })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
});
} else {
api.goodsPage({ pageNo, pageSize, categoryId: goodsCateId.value, name: name.value })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
}
};
const toGoods = (e) => {
uni.navigateTo({
url: `/pages/goods/goods?id=${e}`
});
};
const clear = () => {
name.value = '';
paging.value.reload();
};
const search = (e) => {
name.value = e.value;
paging.value.reload();
};
let swichMenu = (index, id) => {
current.value = index;
goodsCateId.value = id;
paging.value.reload();
// api.goodsPage({ categoryId: id }).then((res) => {
// goodsList.value = res.list;
// });
};
</script>
<style lang="scss" scoped>
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
}
.u-search-box {
padding: 18rpx 30rpx;
}
.u-menu-wrap {
flex: 1;
display: flex;
overflow: hidden;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text {
font-size: 26rpx;
color: #799675;
margin-left: 10rpx;
}
.u-tab-view {
width: 200rpx;
height: 100%;
}
.u-tab-item {
height: 110rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #444;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active {
position: relative;
color: #799675;
font-size: 30rpx;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: '';
position: absolute;
border-left: 4px solid #799675;
height: 32rpx;
left: 0;
top: 39rpx;
}
.u-tab-view {
height: 100%;
}
.right-box {
width: 550rpx;
flex: 1;
background-color: #fff;
// background-color: rgb(250, 250, 250);
}
.page-view {
padding: 16rpx;
&_item {
display: flex;
align-items: center;
margin-bottom: 25rpx;
image {
width: 160rpx;
height: 160rpx;
margin-right: 22rpx;
border-radius: 18rpx;
}
&_title {
font-size: 28rpx;
font-weight: bold;
color: #232323;
}
&_info {
font-weight: 400;
font-size: 24rpx;
color: #232323;
margin: 20rpx 0;
}
&_price {
display: flex;
align-items: center;
&_left {
font-weight: bold;
font-size: 38rpx;
color: #ff2929;
margin-right: 35rpx;
}
&_right {
font-size: 24rpx;
color: #999999;
text-decoration-line: line-through;
}
}
}
}
.class-item {
margin-bottom: 30rpx;
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
}
.item-title {
font-size: 26rpx;
color: #000;
font-weight: bold;
}
.item-menu-name {
font-weight: normal;
font-size: 24rpx;
color: #000;
}
.item-container {
display: flex;
flex-wrap: wrap;
}
.thumb-box {
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
}
.item-menu-image {
width: 120rpx;
height: 120rpx;
}
</style>

207
pages/equity/equity.vue Normal file
View File

@@ -0,0 +1,207 @@
<template>
<view>
<image src="/static/equityBei.png" style="width: 750rpx; height: 768rpx; position: absolute; top: 0; left: 0; z-index: -1" mode="widthFix"></image>
<wd-navbar title="权益包" :bordered="false" left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<view style="padding: 35rpx 80rpx; position: relative">
<image src="/static/equity_pack.png" style="width: 593rpx; height: 345rpx" mode="widthFix" v-if="!userInfo.userRights"></image>
<image src="/static/equity/s1.png" style="width: 593rpx; height: 345rpx" mode="widthFix" v-if="userInfo.userRights && userInfo.userRights.rightsLevel == 1"></image>
<image src="/static/equity/s2.png" style="width: 593rpx; height: 345rpx" mode="widthFix" v-if="userInfo.userRights && userInfo.userRights.rightsLevel == 2"></image>
<image src="/static/equity/s3.png" style="width: 593rpx; height: 345rpx" mode="widthFix" v-if="userInfo.userRights && userInfo.userRights.rightsLevel == 3"></image>
<view
v-if="userInfo.userRights"
:style="{
color:
userInfo.userRights.rightsLevel == 1 ? '#754023' : userInfo.userRights.rightsLevel == 2 ? '#3874AF' : userInfo.userRights.rightsLevel == 3 ? '#AF3838' : ''
}"
style="position: absolute; top: 120rpx; left: 280rpx; font-size: 28rpx"
>
{{ userInfo.userRights.rightsDiscount / 10 }}
</view>
<view
v-if="userInfo.userRights"
:style="{
color:
userInfo.userRights.rightsLevel == 1 ? '#754023' : userInfo.userRights.rightsLevel == 2 ? '#3874AF' : userInfo.userRights.rightsLevel == 3 ? '#AF3838' : ''
}"
style="position: absolute; top: 180rpx; left: 140rpx; font-size: 28rpx; font-weight: bold"
>
抵扣卷剩余{{ userInfo.userRights.pice }}
</view>
<button class="equity_kf" open-type="contact">
<image src="/static/icons/kf.png" style="width: 48rpx; height: 48rpx; margin-right: 10rpx"></image>
联系客服
</button>
</view>
<view style="padding: 0 30rpx">
<view>
<text style="font-weight: bold; font-size: 32rpx; color: #754023">权益包等级</text>
<text style="font-size: 24rpx; color: #7e7e7e; margin-left: 10rpx">点击下方卡片选择开通等级</text>
</view>
<view
v-for="(item, index) in list"
:key="index"
@click="current = index"
style="position: relative; width: 690rpx; height: 224rpx; padding: 24rpx 30rpx; margin-top: 30rpx"
>
<image :src="item.qy" style="width: 128rpx; position: absolute; top: 0; right: 12rpx" mode="widthFix"></image>
<image v-if="current == index" src="/static/icons/gou.png" style="width: 40rpx; height: 40rpx; position: absolute; top: 20rpx; right: 60rpx"></image>
<image :src="item.bei" style="width: 690rpx; height: 224rpx; position: absolute; z-index: -1; top: 0; left: 0"></image>
<view style="display: flex; align-items: center; margin-bottom: 12rpx">
<image :src="item.icon" style="width: 104rpx; height: 44rpx"></image>
<!-- <view>{{ item.name }}</view> -->
</view>
<view style="width: 100%; background-color: #fff; border-radius: 8rpx; padding: 24rpx 40rpx; position: relative">
<view style="font-weight: bold; font-size: 24rpx; color: #232323; margin-bottom: 8rpx">{{ item.info }}</view>
<view style="font-weight: 400; font-size: 28rpx; color: #232323">{{ item.text }}</view>
<view
style="
width: 222rpx;
height: 42rpx;
position: absolute;
right: 0;
bottom: 0;
z-index: 10;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 10rpx;
"
>
<!-- <image :src="item.qy"></image> -->
<view style="font-weight: bold; font-size: 24rpx; color: #ffffff">{{ item.name }}特权</view>
</view>
<image style="width: 222rpx; height: 42rpx; position: absolute; right: 0; bottom: 0; z-index: 9" :src="item.img"></image>
</view>
</view>
<view
style="
width: 690rpx;
height: 82rpx;
background: linear-gradient(180deg, #ffc786 0%, #e99332 100%);
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 50rpx;
color: #fff;
font-size: 30rpx;
font-weight: bold;
"
@click="toCon"
>
立即开通
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { Store } from '@/store';
const store = Store();
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
onShow(async () => {
await store.usersGetInfo();
});
const list = [
{
name: '加盟',
info: '购买、批发商品享5折折扣',
text: '赠送货值抵扣券10000元',
icon: '/static/equity/icon1.png',
bei: '/static/equity/bei1.png',
img: '/static/equity/img1.png',
qy: '/static/equity/iconY1.png',
discount: 0.5,
debitVoucher: 10000
},
{
name: '总代',
info: '购买、批发商品享3.5折折扣',
text: '赠送货值抵扣券40000元',
icon: '/static/equity/icon2.png',
bei: '/static/equity/bei2.png',
img: '/static/equity/img2.png',
qy: '/static/equity/iconY2.png',
discount: 0.35,
debitVoucher: 40000
},
{
name: '官方',
info: '购买、批发商品享2.5折折扣',
text: '赠送货值抵扣券100000元',
icon: '/static/equity/icon3.png',
bei: '/static/equity/bei3.png',
img: '/static/equity/img3.png',
qy: '/static/equity/iconY3.png',
discount: 0.25,
debitVoucher: 100000
}
];
const current = ref<number>(0);
const back = () => {
uni.navigateBack();
};
const toCon = () => {
uni.showModal({
title: '提示',
content: '请联系客服开通权益包',
showCancel: false
});
};
</script>
<style lang="scss" scoped>
.equity {
display: flex;
align-items: center;
&_kf {
position: absolute;
top: 60rpx;
right: 0;
background: rgba(255, 255, 255, 0.68);
border-radius: 30rpx 0rpx 0rpx 30rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #232323;
padding: 5rpx 30rpx 5rpx 30rpx;
}
}
button {
all: unset;
}
button::after {
all: unset;
}
</style>

191
pages/goods/goods.vue Normal file
View File

@@ -0,0 +1,191 @@
<template>
<view class="goods">
<!-- 返回按钮 -->
<wd-navbar fixed :bordered="false" left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<wd-swiper height="750rpx" :list="goods.images" autoplay v-model:current="current">
<template #indicator="{ current, total }">
<view class="custom-indicator">{{ current + 1 }}/{{ total }}</view>
<view class="goods_sals">销量{{ goods.sales }}</view>
</template>
</wd-swiper>
<view style="height: 35rpx"></view>
<view class="goods_block">
<view>
<view class="goods_block_tit">{{ goods.name }}</view>
<view class="goods_block_stock">库存{{ goods.stock }}</view>
</view>
<view style="margin-top: 20rpx">
<view class="goods_block_spec">{{ goods.specs }}</view>
<view class="goods_block_price">{{ goods.currentPrice }}</view>
</view>
</view>
<view style="font-weight: bold; font-size: 30rpx; color: #232323; margin: 30rpx 0 25rpx; text-align: center">商品详情</view>
<view style="background-color: #fff">
<mp-html :content="goods.detail" />
<!-- <rich-text :nodes="goods.detail"></rich-text> -->
</view>
<view style="height: 145rpx"></view>
<view
style="
display: flex;
align-items: center;
justify-content: space-between;
padding: 35rpx 60rpx;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
border-radius: 24rpx 24rpx 0 0;
width: 100%;
"
>
<view style="display: flex; align-items: center; font-size: 24rpx">
<button style="margin-right: 24rpx" open-type="share">
<image style="width: 40rpx; height: 40rpx" src="/static/icons/fx.png"></image>
<view>分享</view>
</button>
<button open-type="contact">
<image style="width: 40rpx; height: 40rpx" src="/static/icons/goodkf.png"></image>
<view>客服</view>
</button>
</view>
<view
style="
width: 468rpx;
height: 70rpx;
background: #ffffff;
border-radius: 12rpx;
border: 1rpx solid #5d7a4e;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 28rpx;
color: #5d7a4e;
"
@click="toConfirm"
>
立即购买
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import api from '@/api/index';
import { useNav } from '@/hooks/useNav';
const { navTo } = useNav();
const current = ref<number>(0);
const swiperList = ref(['https://wot-ui.cn/assets/redpanda.jpg', 'https://wot-ui.cn/assets/capybara.jpg']);
const goods = ref({});
interface optionsType {
id: string;
}
onLoad((options: any) => {
api.goodsInfo({ id: options.id }).then((res: any) => {
goods.value = res;
});
});
const toConfirm = () => {
navTo(`/pages/order/confirm?id=${goods.value.id}`, true);
};
const back = () => {
uni.navigateBack();
};
</script>
<style lang="scss" scoped>
.goods {
--wot-swiper-radius: 0;
&_sals {
width: 166rpx;
height: 44rpx;
background: #ffffff;
border-radius: 46rpx 0rpx 0rpx 46rpx;
opacity: 0.5;
position: absolute;
bottom: 30rpx;
right: 0;
font-weight: 400;
font-size: 24rpx;
color: #232323;
display: flex;
align-items: center;
justify-content: center;
}
&_block {
margin: auto;
width: 690rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(22, 22, 23, 0.07);
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 24rpx;
view {
display: flex;
align-items: center;
justify-content: space-between;
}
&_tit {
font-weight: bold;
font-size: 32rpx;
color: #232323;
}
&_stock {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
&_spec {
font-weight: bold;
font-size: 24rpx;
color: #232323;
}
&_price {
font-weight: bold;
font-size: 38rpx;
color: #ff2929;
}
}
}
.custom-indicator {
width: 52rpx;
height: 52rpx;
background: #ffffff;
border-radius: 6rpx 6rpx 6rpx 6rpx;
opacity: 0.5;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #232323;
position: absolute;
top: 170rpx;
right: 24rpx;
}
button {
all: unset;
}
button::after {
all: unset;
}
</style>

126
pages/goods/prefecture.vue Normal file
View File

@@ -0,0 +1,126 @@
<template>
<view class="notice">
<wd-navbar title="进货专区" safeAreaInsetTop left-arrow @click-left="back"></wd-navbar>
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view class="p30">
<view class="home_block" @click="toGoods(item.id)" v-for="(item, index) in dataList" :key="index">
<image class="home_block_left" :src="item.cover"></image>
<view class="home_block_right">
<view class="home_block_right_title">{{ item.name }}</view>
<view class="home_block_right_info">{{ item.specs }}</view>
<view style="display: flex; justify-content: space-between; align-items: center; margin-top: 25rpx">
<view style="font-size: 36rpx; font-weight: bold; color: #ff2929">{{ item.currentPrice }}</view>
<view class="home_block_right_button">下单</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref, computed } from 'vue';
import api from '@/api/index';
const active = ref(1);
const categoryId = ref<string | number>('');
const paging = ref(null);
const dataList = ref([]);
const noticeCateList = ref([]);
onLoad(() => {
api.noticeCatePage().then((res) => {
noticeCateList.value = res.list;
});
});
const activeChange = (e, cateId) => {
active.value = e;
categoryId.value = cateId;
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
api.goodsPage({ pageNo, pageSize, type: active.value, categoryId: categoryId.value,recommended:1 })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
const toGoods = (e) => {
uni.navigateTo({
url: `/pages/goods/goods?id=${e}`
});
};
const back = () => {
uni.navigateBack();
};
</script>
<style lang="scss" scoped>
.notice {
&_block {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 35rpx;
width: 690rpx;
height: 106rpx;
background: #ffffff;
border-radius: 16rpx;
position: relative;
font-weight: 400;
font-size: 24rpx;
color: #232323;
}
}
.home_block {
width: 690rpx;
height: 250rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
padding-right: 25rpx;
margin-bottom: 25rpx;
&_left {
width: 250rpx;
height: 250rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin-right: 25rpx;
}
&_right {
flex: 1;
&_title {
font-weight: 600;
font-size: 28rpx;
color: #232323;
}
&_info {
font-weight: 400;
font-size: 24rpx;
color: #232323;
margin-top: 25rpx;
}
&_button {
width: 128rpx;
height: 48rpx;
background: #ff2a2a;
box-shadow: 0rpx 2rpx 4rpx 2rpx #dbdbdb;
border-radius: 10rpx 10rpx 10rpx 10rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 800;
font-size: 20rpx;
color: #ffffff;
}
}
}
</style>

293
pages/index/index.vue Normal file
View File

@@ -0,0 +1,293 @@
<template>
<view class="home">
<!-- <view class="my-capsule-like-button" :style="capsuleButtonStyle">自定义按钮</view> -->
<view style="width: 100%; height: 582rpx" class="home_top">
<image src="/static/homeBanner.png" style="width: 750rpx; height: 582rpx; position: absolute; top: 0; left: 0; z-index: -1"></image>
<wd-navbar :bordered="false" custom-style="background-color: transparent !important;" safeAreaInsetTop>
<template #left>
<view style="display: flex; align-items: center">
<image
src="/static/logo.png"
style="width: 96rpx; height: 96rpx; margin-right: 25rpx; background-color: rgba(255, 255, 255, 0.3); border-radius: 50%"
></image>
<view style="color: #fff; font-size: 40rpx; font-weight: bold">苗草古方</view>
</view>
</template>
</wd-navbar>
<view class="p30" style="display: flex; align-items: center; justify-content: space-between">
<view style="background-color: #fff; width: 324rpx; border-radius: 20rpx; overflow: hidden" @click="toPrefecture">
<wd-swiper customItemClass="bannerRadius" height="292rpx" :list="['/static/homeY.png']" autoplay v-model:current="current">
<template #indicator="{ current, total }">
<!-- <view style="position: absolute; bottom: -60rpx; right: 24rpx; display: flex; align-items: center; background: #cbcbcb; border-radius: 14rpx">
<view
v-for="i in total"
:key="i"
style="width: 24rpx; height: 8rpx; border-radius: 14rpx"
:style="{ background: current + 1 == i ? '#8FAB7F' : '#cbcbcb' }"
></view>
</view> -->
<!-- <view class="custom-insdicator" style="position: absolute; bottom: 24rpx; right: 24rpx">{{ current + 1 }}/{{ total }}</view> -->
</template>
</wd-swiper>
<view style="height: 72rpx; display: flex; align-items: center; padding: 20rpx; font-size: 28rpx; font-weight: bold">进货专区</view>
</view>
<view class="home_top_block">
<view class="home_top_block_view" style="color: #776926" @click="navTo('/pages/equity/equity', true)">
<image src="/static/hui.png"></image>
<view>
<view style="font-size: 32rpx; font-weight: bold">权益包</view>
<view style="font-size: 24rpx; margin-top: 10rpx">购买权益包</view>
<view style="font-size: 24rpx">至高享七折优惠</view>
</view>
</view>
<view class="home_top_block_view" style="background: #eef4f1; color: #175b39" @click="openCode">
<image src="/static/yao.png"></image>
<view>
<view style="font-size: 32rpx; font-weight: bold">推荐好友</view>
<view style="font-size: 24rpx; margin-top: 10rpx">推荐好友加盟</view>
<view style="font-size: 24rpx">边拿奖励边赚钱</view>
</view>
</view>
</view>
</view>
</view>
<view class="p30">
<wd-swiper :list="swiperList" value-key="image" autoplay v-model:current="current"></wd-swiper>
<view class="mt30" @click="toNotice">
<wd-notice-bar color="#90B77B" background-color="#E2ECDC">
<view slot="prefix">
<image src="/static/warn.png" style="width: 60rpx; height: 60rpx"></image>
</view>
<view style="font-size: 28rpx">{{ noticeList.content }}</view>
</wd-notice-bar>
</view>
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view class="home_block mt30" @click="toGoods(item.id)" v-for="(item, index) in dataList" :key="index">
<image class="home_block_left" :src="item.cover"></image>
<view class="home_block_right">
<view class="home_block_right_title">{{ item.name }}</view>
<view class="home_block_right_info">{{ item.specs }}</view>
<view style="display: flex; justify-content: space-between; align-items: center; margin-top: 25rpx">
<view style="font-size: 36rpx; font-weight: bold; color: #ff2929">{{ item.currentPrice }}</view>
<view class="home_block_right_button">下单</view>
</view>
</view>
</view>
</z-paging>
<!-- <view>
</view> -->
</view>
<uni-popup ref="popup" type="center" border-radius="16rpx">
<view class="shareBlock">
<view style="width: 100%; text-align: right"><image @click="$refs.popup.close()" src="/static/icons/cha.png" class="shareBlock_close"></image></view>
<image class="shareBlock_code" :src="userInfo.inviteCodeImg"></image>
<view class="shareBlock_info">打开微信扫描二维码注册时输入邀请码</view>
<view class="shareBlock_codeInfo">
<view class="shareBlock_codeInfo_left">
邀请码
<text style="text-decoration: underline">{{ userInfo.inviteCode }}</text>
</view>
<view class="shareBlock_codeInfo_right" @click="copy(userInfo.inviteCode)">点击复制</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script lang="ts" setup>
import { ref, computed } from 'vue';
import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
import { Store } from '@/store';
import { copy } from '@/utils/fun';
import api from '@/api/index';
const store = Store();
const userInfo = computed(() => store.userInfo || {});
const popup = ref();
const current = ref<number>(0);
const showShare = ref(false);
const swiperList = ref([]);
const noticeList = ref({
content: ''
});
const list = ref([]);
const paging = ref(null);
const dataList = ref([]);
import { useNav } from '@/hooks/useNav';
const { navTo } = useNav();
const queryList = (pageNo, pageSize) => {
api.goodsPage({ pageNo, pageSize,recommended:1 })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
onLoad(() => {
api.banner({
imageAddress: 1
}).then((res) => {
swiperList.value = res.list;
});
api.noticePage({ type: 1 }).then((res) => {
if (res.list != 0) {
noticeList.value = res.list[0];
}
});
});
const openCode = async () => {
await store.usersGetInfo();
popup.value.open();
};
const toGoods = (e) => {
uni.navigateTo({
url: `/pages/goods/goods?id=${e}`
});
};
const toPrefecture = () => {
uni.navigateTo({
url: '/pages/goods/prefecture'
});
};
const toEquity = () => {
uni.navigateTo({
url: '/pages/equity/equity'
});
};
const toNotice = () => {
uni.navigateTo({
url: '/pages/notice/notice'
});
};
</script>
<style lang="scss" scoped>
.home {
&_top {
--wot-swiper-radius: 0;
&_block {
height: 364rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
&_view {
width: 346rpx;
height: 170rpx;
background: #f7f4e5;
border-radius: 30rpx 30rpx 30rpx 30rpx;
padding: 25rpx;
display: flex;
align-items: center;
image {
width: 100rpx;
height: 100rpx;
margin-right: 24rpx;
}
}
}
}
.custom-indicator {
}
&_block {
width: 690rpx;
height: 250rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
padding-right: 25rpx;
&_left {
width: 250rpx;
height: 250rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin-right: 25rpx;
}
&_right {
flex: 1;
&_title {
font-weight: 600;
font-size: 28rpx;
color: #232323;
}
&_info {
font-weight: 400;
font-size: 24rpx;
color: #232323;
margin-top: 25rpx;
}
&_button {
width: 128rpx;
height: 48rpx;
background: #ff2a2a;
box-shadow: 0rpx 2rpx 4rpx 2rpx #dbdbdb;
border-radius: 10rpx 10rpx 10rpx 10rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 800;
font-size: 20rpx;
color: #ffffff;
}
}
}
}
.shareBlock {
margin: auto;
width: 650rpx;
height: 688rpx;
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
&_close {
width: 68rpx;
height: 68rpx;
}
&_code {
width: 392rpx;
height: 392rpx;
}
&_info {
font-size: 24rpx;
color: #cccccc;
margin: 24rpx 0;
}
&_codeInfo {
display: flex;
align-items: center;
&_left {
font-weight: bold;
font-size: 32rpx;
color: #232323;
}
&_right {
margin-left: 20rpx;
font-size: 24rpx;
color: #999999;
}
}
}
</style>

502
pages/login/login.vue Normal file
View File

@@ -0,0 +1,502 @@
<template>
<view class="login-container">
<!-- 背景图 -->
<image class="bg-image" src="/static/image/login.png" mode="aspectFill"></image>
<!-- 返回按钮 -->
<wd-navbar left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<view class="content">
<!-- Logo -->
<view class="logo-container">你好</view>
<!-- 欢迎文字 -->
<view class="welcome-text">
<view>欢迎来到</view>
<view class="welcome-tag">苗草古方</view>
</view>
<!-- Tab切换 -->
<view class="tabs" v-if="type == 'login'">
<view class="tab-item" :class="{ active: activeTab === 'password' }" @click="switchTabs('password')">
<text>密码登录</text>
<view class="underline" v-if="activeTab === 'password'"></view>
</view>
<view class="tab-item" :class="{ active: activeTab === 'code' }" @click="switchTabs('code')">
<text>验证码登录</text>
<view class="underline" v-if="activeTab === 'code'"></view>
</view>
</view>
<!-- 表单 -->
<view class="form-container">
<!-- 登录 -->
<view v-if="type == 'login'">
<view class="input-item">
<input
placeholder="请输入用户名"
style="font-weight: 600; font-size: 36rpx"
v-model="formData.mobile"
placeholder-style="color: #999999;font-size: 28rpx;font-weight: 400 !important;"
type="number"
/>
</view>
<view class="input-item" v-if="activeTab === 'password'">
<input placeholder="请输入密码" v-model="formData.password" password placeholder-style="color: #999999;;font-size: 28rpx;" />
</view>
<view class="input-item code-input" v-else>
<input placeholder="请输入验证码" v-model="formData.code" placeholder-style="color: #999999;;font-size: 28rpx;" />
<view class="get-code" @click="getCode(1)">{{ current.seconds || codeIngo }}</view>
</view>
</view>
<!-- 注册 -->
<view v-if="type == 'register'">
<view class="input-item">
<input
placeholder="请输入用户名"
type="number"
style="font-weight: 600; font-size: 36rpx"
v-model="registerInfo.mobile"
placeholder-style="color: #999999;font-size: 28rpx;font-weight: 400 !important;"
/>
</view>
<view class="input-item code-input">
<input placeholder="请输入验证码" v-model="registerInfo.code" placeholder-style="color: #999999;;font-size: 28rpx;" />
<view class="get-code" @click="getCode(2)">{{ current.seconds || codeIngo }}</view>
</view>
<view class="input-item">
<input placeholder="请输入您的密码" v-model="registerInfo.password" password placeholder-style="color: #999999;;font-size: 28rpx;" />
</view>
<view class="input-item">
<input placeholder="请再次输入您的密码" v-model="registerInfo.passwordNew" password placeholder-style="color: #999999;;font-size: 28rpx;" />
</view>
<view class="input-item">
<input placeholder="请输入邀请码(非必填)" v-model="registerInfo.inviteCode" placeholder-style="color: #999999;;font-size: 28rpx;" />
</view>
</view>
<!-- 注册链接 -->
<view class="register-text" @click="type = 'login'" v-if="type == 'register'">
<text>已有账号</text>
<text class="register-link">立即登录</text>
</view>
<!-- 登录链接 -->
<view class="register-text" @click="type = 'register'" v-if="type == 'login'">
<text>还没有账号</text>
<text class="register-link">立即注册</text>
</view>
<!-- 登录按钮 -->
<button class="login-btn" :loading="submitLoading" :disabled="submitLoading" @click="login">
{{ type == 'register' ? '注册' : '登录' }}
</button>
<!-- 底部声明 -->
<!-- <view class="agreement" v-if="type == 'login'">
<text>登录即表示接受</text>
<navigator url="/pages/protocol/protocol" class="agreement-link">版权声明</navigator>
<text></text>
<navigator url="/pages/protocol/protocol" class="agreement-link">隐私保护</navigator>
</view> -->
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import api from '@/api/index';
import { toast } from '@/utils/fun.js';
import { useCountDown } from '@/uni_modules/wot-design-uni';
import { Store } from '@/store';
import { onLoad } from '@dcloudio/uni-app';
const store = Store();
const { start, pause, reset, current } = useCountDown({
time: 60 * 1000,
onChange(current) {},
onFinish() {
codeIngo.value = '重新发送';
}
});
const initialRegisterInfo = {
mobile: '',
password: '',
code: '',
inviteCode: '',
passwordNew: ''
};
const registerInfo = ref({ ...initialRegisterInfo });
onLoad(() => {
if (uni.getStorageSync('inviteCode')) {
registerInfo.value.inviteCode = uni.getStorageSync('inviteCode');
console.log(registerInfo.value.inviteCode);
}else{
console.log('未取到邀请码');
}
});
const resetRegisterInfo = () => {
registerInfo.value = { ...initialRegisterInfo };
};
const type = ref('login');
const codeIngo = ref('点击获取验证码');
// 定义当前激活的tab
const activeTab = ref('password');
const formData = ref({
mobile: '',
password: '',
code: ''
});
const submitLoading = ref(false);
// 返回上一页
const back = () => {
uni.navigateBack();
};
const switchTabs = (v) => {
activeTab.value = v;
formData.value = {};
};
// 获取验证码方法
const getCode = (e) => {
if (!formData.value.mobile && e == 1) {
toast('请输入手机号');
return;
}
if (!registerInfo.value.mobile && e == 2) {
toast('请输入手机号');
return;
}
if (current.value.seconds) {
toast('请等待倒计时结束');
return;
}
api.smsCode({
mobile: e == 2 ? registerInfo.value.mobile : formData.value.mobile,
scene: 1
})
.then((res) => {
start();
toast('验证码发送成功');
})
.catch((err) => {
console.log(err);
toast('验证码发送失败');
});
};
// 登录方法
const login = () => {
// 注册
if (type.value == 'register') {
if (!registerInfo.value.mobile) return toast('请输入手机号码');
if (!registerInfo.value.code) return toast('请输入验证码');
if (!registerInfo.value.password) return toast('请输入密码');
if (!registerInfo.value.passwordNew) return toast('请再次输入密码');
if (registerInfo.value.password != registerInfo.value.passwordNew) return toast('两次密码输入不一致');
// if (!registerInfo.value.inviteCode) return toast('请输入邀请码');
api.registerApi(registerInfo.value).then((res) => {
uni.showModal({
title: '提示',
content: '注册成功',
showCancel: false,
success: (res) => {
type.value = 'login';
resetRegisterInfo();
}
});
});
} else {
if (!formData.value.mobile) return toast('请输入手机号码');
if (activeTab.value === 'password') {
if (!formData.value.password) return toast('请输入登录密码');
api.loginApi(formData.value).then((res: any) => {
uni.setStorageSync('Authorization', res.accessToken);
store.setUserId(res.userId);
store.usersGetInfo();
back();
});
} else {
if (!formData.value.code) return toast('请输入验证码');
api.smsLoginApi(formData.value).then((res: any) => {
uni.setStorageSync('Authorization', res.accessToken);
store.setUserId(res.userId);
store.usersGetInfo();
back();
});
}
}
// if (activeTab.value === 'code') {
// if (!formData.value?.phone) {
// uni.showToast({
// title: '请输入手机号',
// icon: 'none'
// });
// return;
// }
// if (!formData.value?.code) {
// uni.showToast({
// title: '请输入验证码',
// icon: 'none'
// });
// return;
// }
// } else {
// if (!formData.value?.mobile) {
// uni.showToast({
// title: '请输入用户名',
// icon: 'none'
// });
// return;
// }
// if (!formData.value?.password) {
// uni.showToast({
// title: '请输入密码',
// icon: 'none'
// });
// return;
// }
// }
// submitLoading.value = true;
// uni.showLoading({
// title: '登录中...'
// });
// wx.login({
// success(loginRes) {
// if (loginRes.code) {
// //发起网络请求
// formData.value.socialCode = loginRes.code;
// // formData.value.socialState = ""
// loginApi({ ...formData.value })
// .then((res) => {
// if (res?.accessToken) {
// uni.hideLoading();
// store.commit('setToken', res.accessToken);
// getUser()
// .then((resUser) => {
// uni.hideLoading();
// store.commit('setUserInfo', { id: res.userId, ...resUser });
// // uni.switchTab({ url: "/pages/mine/mine" })
// navigateBackOrUrl('/pages/mine/mine', true);
// submitLoading.value = false;
// uni.showToast({
// title: '登录成功',
// icon: 'success'
// });
// })
// .catch((err) => {
// uni.showToast({
// title: '获取用户信息失败',
// icon: 'none'
// });
// uni.hideLoading();
// submitLoading.value = false;
// });
// } else {
// uni.showToast({
// title: '登录失败',
// icon: 'none'
// });
// uni.hideLoading();
// submitLoading.value = false;
// }
// })
// .catch((err) => {
// uni.hideLoading();
// submitLoading.value = false;
// });
// } else {
// console.log('登录失败!' + loginRes.errMsg);
// }
// },
// fail(err) {
// console.log('wx.login err', err);
// }
// });
};
// 跳转到注册页
const toRegister = () => {
uni.navigateTo({
url: '/pages/login/register'
});
};
</script>
<style lang="scss" scoped>
.login-container {
position: relative;
width: 100%;
height: 100vh;
}
.bg-image {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.back-btn {
position: absolute;
top: 100rpx;
left: 40rpx;
width: 40rpx;
height: 40rpx;
z-index: 10;
}
.content {
padding: 0 65rpx;
margin-top: 180rpx;
position: absolute;
}
.logo-container {
margin-bottom: 8rpx;
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
.logo {
width: 180rpx;
height: 180rpx;
}
.welcome-text {
font-weight: bold;
font-size: 44rpx;
color: #232323;
text-align: center;
margin-bottom: 60rpx;
display: flex;
align-items: flex-end;
}
.welcome-tag {
color: #5d7a4e;
margin-left: 12rpx;
font-size: 44rpx;
}
.tabs {
display: flex;
margin-bottom: 40rpx;
}
.tab-item {
position: relative;
margin-right: 60rpx;
// padding-bottom: 20rpx;
}
.tab-item text {
font-weight: bold;
font-size: 28rpx;
}
.tab-item.active text {
color: #232323;
}
.tab-item:not(.active) text {
color: #999999;
}
.underline {
width: 104rpx;
height: 4rpx;
background: #5d7a4e;
border-radius: 170rpx;
}
.form-container {
width: 100%;
}
.input-item {
width: 620rpx;
height: 90rpx;
background: #ffffff;
border-radius: 14rpx;
border: 2rpx solid #f6f6f6;
margin-bottom: 30rpx;
padding: 0 30rpx;
display: flex;
align-items: center;
}
.input-item input {
width: 100%;
height: 100%;
font-size: 28rpx;
color: #333333;
}
.code-input {
input {
flex: 1;
}
.get-code {
font-size: 24rpx;
color: #8e8e8e;
margin-left: 20rpx;
}
}
.register-text {
display: flex;
margin-bottom: 210rpx;
font-size: 26rpx;
color: #232323;
}
.register-link {
color: #5d7a4e;
margin-left: 10rpx;
}
.login-btn {
width: 474rpx;
height: 78rpx;
line-height: 78rpx;
border-radius: 39rpx;
text-align: center;
color: #fff !important;
font-size: 28rpx;
margin: 0 auto;
margin-bottom: 40rpx;
background: #5d7a4e !important;
&::after {
border: none;
}
}
.agreement {
display: flex;
justify-content: center;
font-size: 24rpx;
color: #999999;
}
.agreement-link {
color: #5d7a4e;
margin: 0 10rpx;
}
</style>

522
pages/mine/mine.vue Normal file
View File

@@ -0,0 +1,522 @@
<template>
<view class="container">
<image src="/static/mineBanner.png" style="width: 750rpx; height: 762rpx; position: fixed; top: 0; left: 0; z-index: -1"></image>
<wd-navbar :bordered="false" custom-style="background-color: transparent !important;" safeAreaInsetTop></wd-navbar>
<view class="p30">
<!-- 用户信息头部 -->
<view class="user-header">
<image class="avatar" :src="userInfo.avatar"></image>
<view class="user-info">
<view class="username">{{ userInfo.nickname || '微信用户' }}</view>
<view class="phone">{{ userInfo.mobile }}</view>
</view>
<view class="invite-code" v-if="userInfo.inviteCodeImg" @click="$refs.popup.open()">
<image style="width: 38rpx; height: 38rpx" src="/static/icons/code.png"></image>
<text>邀请码</text>
</view>
</view>
<!-- 优惠提示栏 -->
<view class="promo-bar">
<text>购买权益包至高享2.5折优惠</text>
<view class="go-shop" @click="navTo('/pages/equity/equity', true)">
<text>去下单</text>
<image src="/static/icons/youh.png" style="width: 26rpx; height: 26rpx"></image>
</view>
</view>
<!-- 我的钱包 -->
<view class="wallet-section" @click="navTo('/pages/wallet/wallet', true)">
<view class="section-title">
<text>我的钱包</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</view>
<view class="wallet-cards">
<view class="wallet-item">
<text class="amount red">{{ userInfo.money || 0 }}</text>
<text class="label">余额</text>
<text class="desc">包含奖励</text>
</view>
<view class="wallet-item">
<text class="amount">{{ userInfo.performanceReward || 0 }}</text>
<text class="label">业绩奖励</text>
<text class="desc">售出分成</text>
</view>
<view class="wallet-item">
<text class="amount">{{ userInfo.directReferralReward || 0 }}</text>
<text class="label">直推奖励</text>
</view>
<view class="wallet-item">
<text class="amount">{{ userInfo.indirectReferralReward || 0 }}</text>
<text class="label">间推奖励</text>
</view>
</view>
</view>
<!-- 我的订单 -->
<!-- <view class="order-section">
<view class="section-title">
<text>我的订单</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</view>
<view class="order-types">
<view class="order-type">
<image src="/static/icons/wait-pay.png"></image>
<text>待付款</text>
</view>
<view class="order-type">
<image src="/static/icons/pre-order.png"></image>
<text>已预定</text>
</view>
<view class="order-type">
<image src="/static/icons/finished.png"></image>
<text>已完成</text>
</view>
<view class="order-type">
<image src="/static/icons/cancelled.png"></image>
<text>已取消</text>
</view>
</view>
</view> -->
<!-- 功能列表 -->
<view class="function-list">
<view class="function-item" @click="navTo('/pages/mine/sett', true)">
<image src="/static/icons/info.png"></image>
<text>个人信息</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</view>
<view class="function-item" @click="navTo('/pages/wallet/list', true)">
<image src="/static/icons/money.png"></image>
<text>我的账单</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</view>
<view class="function-item" @click="navTo('/pages/team/team', true)">
<image src="/static/icons/tj.png"></image>
<text>我的团队</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</view>
<view class="function-item" @click="navTo('/pages/address/list', true)">
<image src="/static/icons/address.png"></image>
<text>地址管理</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</view>
<!-- <view class="function-item">
<image src="/static/icons/tjr.png"></image>
<text>推荐人</text>
<text class="info">{{ userInfo.puser ? `${userInfo.puser.nickname} ${userInfo.puser.mobile}` : '无' }}</text>
</view> -->
<button class="function-item" open-type="contact">
<image src="/static/icons/kf.png"></image>
<text>联系客服</text>
<image src="/static/y.png" style="width: 34rpx; height: 34rpx"></image>
</button>
</view>
</view>
<uni-popup ref="popup" type="center" border-radius="16rpx">
<view class="shareBlock">
<view style="width: 100%; text-align: right"><image @click="$refs.popup.close()" src="/static/icons/cha.png" class="shareBlock_close"></image></view>
<image class="shareBlock_code" :src="userInfo.inviteCodeImg"></image>
<view class="shareBlock_info">打开微信扫描二维码注册时输入邀请码</view>
<view class="shareBlock_codeInfo">
<view class="shareBlock_codeInfo_left">
邀请码
<text style="text-decoration: underline">{{ userInfo.inviteCode }}</text>
</view>
<view class="shareBlock_codeInfo_right" @click="copy(userInfo.inviteCode)">点击复制</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { lookImg,copy } from '@/utils/fun.js';
import { Store } from '@/store';
import { useNav } from '@/hooks/useNav';
const { navTo } = useNav();
const store = Store();
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
onShow(async () => {
await store.usersGetInfo();
});
// export default {
// data() {
// return {
// userInfo: {
// nickname: '九天应援雷声普化天尊',
// phone: '1863****301'
// },
// wallet: {
// balance: '23万',
// performanceReward: '98456',
// directReward: '68230',
// indirectReward: '63314'
// },
// orderTypes: [
// { type: 'waitPay', name: '待付款' },
// { type: 'preOrder', name: '已预定' },
// { type: 'finished', name: '已完成' },
// { type: 'cancelled', name: '已取消' }
// ],
// functions: [
// { name: '我的账单', icon: 'bill' },
// { name: '我的推荐', icon: 'recommend' },
// { name: '联系客服', icon: 'service' },
// { name: '推荐人', info: '北极**大帝 1863****301', icon: 'referrer' },
// { name: '个人信息', icon: 'profile' }
// ]
// };
// },
// onLoad() {
// // 页面加载时执行的逻辑
// },
// methods: {
// // 点击钱包项目
// onWalletItemTap(e) {
// const { index } = e.currentTarget.dataset;
// const items = ['余额', '业绩奖励', '直推奖励', '间推奖励'];
// uni.showToast({
// title: `查看${items[index]}详情`,
// icon: 'none'
// });
// },
// // 点击订单类型
// onOrderTypeTap(e) {
// const { index } = e.currentTarget.dataset;
// const types = ['待付款', '已预定', '已完成', '已取消'];
// uni.showToast({
// title: `查看${types[index]}订单`,
// icon: 'none'
// });
// },
// // 点击功能项
// onFunctionTap(e) {
// const { index } = e.currentTarget.dataset;
// const names = ['我的账单', '我的推荐', '联系客服', '推荐人', '个人信息'];
// uni.showToast({
// title: `进入${names[index]}页面`,
// icon: 'none'
// });
// },
// // 进入个人中心
// goToProfile() {
// uni.navigateTo({
// url: '/pages/profile/index'
// });
// },
// // 查看邀请码
// viewInviteCode() {
// uni.showModal({
// title: '邀请码',
// content: '您的邀请码123456',
// showCancel: false
// });
// },
// // 去下单
// goToOrder() {
// uni.navigateTo({
// url: '/pages/order/index'
// });
// }
// }
// };
</script>
<style scoped lang="scss">
.container {
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}
/* 用户信息头部 */
.user-header {
background-size: cover;
padding: 40rpx 30rpx 60rpx;
display: flex;
/* align-items: center; */
position: relative;
}
.user-header::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.avatar {
width: 152rpx;
height: 152rpx;
border-radius: 50%;
margin-right: 20rpx;
background-color: #eee;
}
.user-info {
flex: 1;
z-index: 1;
height: 152rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.username {
font-size: 34rpx;
font-weight: bold;
color: #333;
}
.phone {
font-size: 30rpx;
color: #666;
margin-top: 24rpx;
}
.invite-code {
display: flex;
align-items: center;
flex-direction: column;
z-index: 1;
}
.invite-code text {
font-size: 24rpx;
color: #232323;
margin-top: 10rpx;
}
.qrcode-btn {
display: flex;
align-items: center;
font-size: 26rpx;
color: #666;
}
.arrow {
margin-left: 6rpx;
color: #999;
}
/* 优惠提示栏 */
.promo-bar {
width: 638rpx;
height: 70rpx;
background: #799675;
border-radius: 16rpx 16rpx 0rpx 0rpx;
padding: 0 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
margin: 0 auto;
font-weight: bold;
font-size: 24rpx;
color: #ffff94;
}
.go-shop {
display: flex;
align-items: center;
}
/* 钱包区域 */
.wallet-section {
background-color: white;
margin: 0rpx 0 20rpx;
padding: 30rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
.section-title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10rpx 0 20rpx;
font-size: 32rpx;
font-weight: bold;
color: #333;
border-bottom: 1px solid #eee;
margin-bottom: 20rpx;
}
.wallet-cards {
display: flex;
justify-content: space-between;
}
.wallet-item {
display: flex;
flex-direction: column;
flex: 1;
text-align: center;
}
.label {
font-size: 28rpx;
color: #666;
}
.amount {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.red {
color: #ff4d4f;
}
.desc {
font-size: 20rpx;
color: #999;
margin-top: 6rpx;
}
/* 订单区域 */
.order-section {
background-color: white;
margin-bottom: 20rpx;
padding: 30rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
.order-types {
display: flex;
justify-content: space-between;
margin-top: 20rpx;
}
.order-type {
display: flex;
flex-direction: column;
align-items: center;
width: 22%;
}
.order-type image {
width: 56rpx;
height: 56rpx;
margin-bottom: 10rpx;
}
.order-type text {
font-size: 26rpx;
color: #232323;
}
/* 功能列表 */
.function-list {
background-color: white;
margin-bottom: 20rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
.function-item {
display: flex;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #f7f7f7;
}
.function-item image {
width: 48rpx;
height: 48rpx;
margin-right: 20rpx;
}
.function-item text {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: bold;
}
.info {
color: #232323 !important;
font-weight: 500 !important;
text-align: right;
}
button {
all: unset;
}
button::after {
all: unset;
}
.shareBlock {
margin: auto;
width: 650rpx;
height: 688rpx;
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
&_close {
width: 68rpx;
height: 68rpx;
}
&_code {
width: 392rpx;
height: 392rpx;
}
&_info {
font-size: 24rpx;
color: #cccccc;
margin: 24rpx 0;
}
&_codeInfo {
display: flex;
align-items: center;
&_left {
font-weight: bold;
font-size: 32rpx;
color: #232323;
}
&_right {
margin-left: 20rpx;
font-size: 24rpx;
color: #999999;
}
}
}
</style>

246
pages/mine/mobile.vue Normal file
View File

@@ -0,0 +1,246 @@
<template>
<view class="page-container">
<!-- 旧手机号输入区 -->
<view class="form-group">
<text class="label">旧手机号</text>
<input class="input" type="number" placeholder="请输入旧手机号" disabled :value="userInfo.mobile" maxlength="11" />
</view>
<!-- 短信验证码区 -->
<view class="form-group code-group">
<text class="label">短信验证码</text>
<input class="input" type="number" placeholder="请输入短信验证码" v-model="formData.oldCode" maxlength="6" />
<view class="code-btn" @click="getCode1">{{ current1.seconds || codeIngo1 }}</view>
</view>
<!-- 新手机号输入区 -->
<view class="form-group">
<text class="label">新手机号</text>
<input class="input" type="number" placeholder="请输入新手机号" v-model="formData.mobile" maxlength="11" />
</view>
<!-- 短信验证码区 -->
<view class="form-group code-group">
<text class="label">短信验证码</text>
<input class="input" type="number" placeholder="请输入短信验证码" v-model="formData.code" maxlength="6" />
<view class="code-btn" @click="getCode2">{{ current2.seconds || codeIngo2 }}</view>
</view>
<!-- 确定按钮 -->
<button class="confirm-btn" @click="handleSubmit">确定</button>
<!-- 温馨提示 -->
<view class="tips">
<text class="tips-title">温馨提醒</text>
<text class="tips-item">1. 一个手机号只能作为一个账户的登录名</text>
<text class="tips-item">2. 手机号修改成功后原手机号将不支持登录</text>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { toast } from '@/utils/fun.js';
import { useCountDown } from '@/uni_modules/wot-design-uni';
import api from '@/api/index';
import { Store } from '@/store';
import { onShow } from '@dcloudio/uni-app';
const store = Store();
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
onShow(async () => {
await store.usersGetInfo();
});
const codeIngo1 = ref('获取验证码');
const codeIngo2 = ref('获取验证码');
const formData = ref({
code: '',
mobile: '',
oldCode: ''
});
const {
start: start1,
pause: pause1,
reset: reset1,
current: current1
} = useCountDown({
time: 60 * 1000,
onChange(current) {},
onFinish() {
codeIngo1.value = '重新发送';
}
});
const {
start: start2,
pause: pause2,
reset: reset2,
current: current2
} = useCountDown({
time: 60 * 1000,
onChange(current) {},
onFinish() {
codeIngo2.value = '重新发送';
}
});
// 获取验证码方法
const getCode1 = (e) => {
if (!userInfo.value.mobile) {
toast('请输入旧手机号');
return;
}
if (current1.value.seconds) {
toast('请等待倒计时结束');
return;
}
api.smsCode({
mobile: userInfo.value.mobile,
scene: 2
})
.then((res) => {
start1();
toast('验证码发送成功');
})
.catch((err) => {
console.log(err);
toast('验证码发送失败');
});
};
// 获取验证码方法
const getCode2 = (e) => {
if (!formData.value.mobile) {
toast('请输入旧手机号');
return;
}
if (current2.value.seconds) {
toast('请等待倒计时结束');
return;
}
api.smsCode({
mobile: formData.value.mobile,
scene: 2
})
.then((res) => {
start2();
toast('验证码发送成功');
})
.catch((err) => {
console.log(err);
toast('验证码发送失败');
});
};
const handleSubmit = () => {
api.updateMobile(formData.value).then((res) => {
uni.showModal({
title: '提示',
content: '修改成功',
showCancel: false,
success: async () => {
await store.usersGetInfo();
uni.navigateBack();
}
});
});
};
</script>
<style scoped>
.page-container {
padding: 30rpx;
background-color: #fff;
}
/* 表单组通用样式 */
.form-group {
display: flex;
align-items: center;
margin-bottom: 40rpx;
}
.label {
font-size: 26rpx;
color: #333;
width: 180rpx; /* 固定标签宽度,保证输入框对齐 */
font-weight: bold;
}
.input {
flex: 1;
height: 60rpx;
line-height: 60rpx;
border-bottom: 1px solid #eee; /* 底部下划线 */
font-size: 28rpx;
color: #666;
}
/* 验证码按钮组 */
.code-group {
justify-content: space-between; /* 输入框与按钮左右分布 */
}
.code-btn {
width: 175rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
color: #5d7a4e;
border: 1rpx solid #5d7a4e;
text-align: center;
border-radius: 14rpx 14rpx 14rpx 14rpx;
}
/* 确定按钮 */
.confirm-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
color: #fff;
background-color: #5d7a4e; /* 深绿 */
border-radius: 10rpx;
margin-top: 50rpx;
}
/* 温馨提示 */
.tips {
margin-top: 60rpx;
font-size: 26rpx;
color: #999;
line-height: 44rpx;
}
.tips-title {
display: block;
margin-bottom: 20rpx;
font-weight: 500;
}
.tips-item {
display: block;
}
</style>

274
pages/mine/sett.vue Normal file
View File

@@ -0,0 +1,274 @@
<template>
<view class="container">
<!-- 返回按钮 -->
<wd-navbar :bordered="false" left-arrow custom-style="background-color: transparent !important;" title="个人信息" safeAreaInsetTop @click-left="back"></wd-navbar>
<image src="/static/settbie.png" style="width: 750rpx; height: 690rpx; position: absolute; top: 0; left: 0; z-index: -1" mode="widthFix"></image>
<view style="padding: 30rpx">
<!-- 卡片 -->
<view class="card">
<!-- 头像行 -->
<view class="avatar-row">
<text class="label">头像</text>
<button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="chooseAvatar">
<view class="avatar-uploader">
<image v-if="userInfo.avatar" :src="userInfo.avatar" class="avatar-image"></image>
<view v-else class="avatar-placeholder">
<image src="/static/icon/icon_img.png"></image>
</view>
</view>
</button>
</view>
<!-- 昵称 -->
<view class="form-row" @click="prompt">
<text class="label required">账户名称</text>
<view class="form-row-right" style="font-size: 28rpx">
<view>{{ userInfo.nickname || '微信用户' }}</view>
<image src="/static/y.png" style="opacity: 0.5; width: 30rpx; height: 30rpx" mode="widthFix"></image>
</view>
</view>
<!-- 手机号 -->
<view class="form-row" @click="toPhone">
<text class="label required">手机号</text>
<view class="form-row-right" style="font-size: 28rpx">
<view>{{ userInfo.mobile }}</view>
<image src="/static/y.png" style="opacity: 0.5; width: 30rpx; height: 30rpx" mode="widthFix"></image>
</view>
</view>
<!-- 等级 -->
<view class="form-row">
<text class="label required">等级</text>
<view style="font-size: 28rpx" v-if="userInfo.userRights">{{userInfo.userRights.rights.rightsName}}</view>
<view style="font-size: 28rpx" v-else>-</view>
</view>
</view>
<!-- 保存按钮 -->
<view class="save-btn" @click="logout">退出登录</view>
</view>
<!-- prompt -->
<wd-message-box />
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import api from '@/api/index';
import { uploadFiles } from '@/utils/fun.js';
import { Store } from '@/store';
import { useMessage } from '@/uni_modules/wot-design-uni';
const message = useMessage();
const store = Store();
const back = () => {
uni.navigateBack();
};
const userInfo = computed(() => store.userInfo || {});
// 表单数据
const form = ref({
avatar: '',
nickname: '',
mobile: '',
sex: 0
});
onShow(async () => {
await store.usersGetInfo();
});
onLoad(async () => {
const storage = uni.getStorageSync('userInfo');
if (storage) {
const getData = await getUser();
uni.setStorageSync('userInfo', getData);
form.value = { ...getData };
}
});
function prompt() {
message
.prompt({
title: '请输入昵称',
inputValue: form.value.nickname
})
.then(async (res) => {
await api.usersUpdate({ nickname: res.value || '微信用户' });
await store.usersGetInfo();
})
.catch((error) => {
console.log(error);
});
}
// 头像
const avatarUrl = ref('');
// 选择头像
const chooseAvatar = async (e) => {
try {
if (e.detail.avatarUrl) {
const imgUrl = await uploadFiles(e.detail.avatarUrl);
await api.usersUpdate({ avatar: imgUrl, mobile: userInfo.value.mobile, nickname: userInfo.value.nickname || '微信用户' });
await store.usersGetInfo();
// form.value.avatar = imgUrl;
}
} catch (err) {
console.error('选择头像失败:', err);
}
};
const chooseAvatarApp = async (e) => {
try {
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function (res) {
console.log(res.tempFilePaths);
uploadFiles(res.tempFilePaths[0]).then((img) => {
console.log(img);
form.value.avatar = img;
});
}
});
} catch (err) {
console.error('选择头像失败:', err);
}
};
// 保存
const logout = async () => {
uni.showModal({
title: '提示',
content: `是否确认退出登录?`,
success: function (res) {
if (res.confirm) {
store.logoutUser();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
};
const toPhone = () => {
uni.navigateTo({
url: '/pages/mine/mobile'
});
};
</script>
<style lang="scss" scoped>
.container {
// padding: 30rpx;
}
.card {
border-radius: 16rpx;
padding: 0 30rpx;
background-color: #fff;
}
.avatar-row {
height: 170rpx;
display: flex;
align-items: center;
justify-content: space-between;
.avatar-btn {
width: 90rpx;
height: 90rpx;
margin: 0;
padding: 0;
border-radius: 50%;
&::after {
border-width: 0;
}
}
.label {
font-size: 28rpx;
color: #232323;
}
}
.avatar-uploader {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
position: relative;
.avatar-image {
width: 100%;
height: 100%;
}
.avatar-placeholder {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
image {
width: 90rpx;
height: 90rpx;
background-color: #f5f5f5;
}
}
}
.form-row {
height: 82rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #f5f5f5;
.label {
font-size: 28rpx;
color: #232323;
}
.input {
flex: 1;
text-align: right;
font-size: 24rpx;
color: #232323;
padding-left: 20rpx;
}
.input-disabled {
color: #999;
}
}
.form-row-right {
display: flex;
align-items: center;
justify-content: space-between;
image {
margin-left: 10rpx;
}
}
.save-btn {
margin-top: 35rpx;
width: 690rpx;
height: 110rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 8rpx 2rpx rgba(0, 88, 219, 0.06);
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 30rpx;
color: #5d7a4e;
}
</style>

32
pages/notice/details.vue Normal file
View File

@@ -0,0 +1,32 @@
<template>
<view style="padding: 30rpx">
<view style="font-size: 34rpx">{{ articleItem.title }}</view>
<view style="height: 20rpx"></view>
<view style="color: #999; font-size: 30rpx">发布时间{{ timeFormat(articleItem.createTime, 'yyyy-MM-dd hh:mm:ss') }}</view>
<view style="height: 20rpx"></view>
<video v-if="articleItem.video" style="width: 690rpx; height: 388rpx" :poster="articleItem.cover" :src="articleItem.video" :direction="90"></video>
<view style="height: 20rpx"></view>
<view>
<mp-html :content="articleItem.content" />
</view>
<view style="50rpx"></view>
</view>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref, computed } from 'vue';
import api from '@/api/index';
import { timeFormat } from '@/utils/fun.js';
const articleItem = ref({});
onLoad((options: any) => {
api.noticeInfo({ id: options.id }).then((res) => {
articleItem.value = res;
});
});
</script>
<style></style>

138
pages/notice/notice.vue Normal file
View File

@@ -0,0 +1,138 @@
<template>
<view class="notice">
<wd-navbar title="公告" safeAreaInsetTop left-arrow @click-left="back"></wd-navbar>
<!-- 顶部导航栏 -->
<view class="nav-tabs">
<view class="tab-item" :class="active == 1 ? 'active' : ''" @click="activeChange(1, '')">通知</view>
<!-- <view class="tab-item" :class="active == 2 ? 'active' : ''" @click="activeChange(2, null)">公告</view> -->
<view
class="tab-item"
:class="active == 2 && categoryId == item.id ? 'active' : ''"
@click="activeChange(2, item.id)"
v-for="(item, index) in noticeCateList"
:key="index"
>
{{ item.categoryName }}
</view>
</view>
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view class="p30">
<view class="notice_block" v-for="(item, index) in dataList" :key="index" @click="toDeitl(item)">
<view>
{{ active == 1 ? '通知' : active == 2 ? noticeCateList.find((val) => val.id == categoryId).categoryName : '' }}{{
active == 1 ? item.content : item.title
}}
</view>
<image style="width: 40rpx; height: 40rpx" src="/static/y.png" v-if="active == 2"></image>
</view>
</view>
</z-paging>
</view>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref, computed } from 'vue';
import api from '@/api/index';
const active = ref(1);
const categoryId = ref<string | number>('');
const paging = ref(null);
const dataList = ref([]);
const noticeCateList = ref([]);
onLoad(() => {
api.noticeCatePage().then((res) => {
noticeCateList.value = res.list;
});
});
const toDeitl = (item) => {
if (active.value == 1) {
uni.showModal({
title: '通知',
content: item.content,
showCancel: false
});
} else {
uni.navigateTo({
url: '/pages/notice/details?id=' + item.id
});
}
};
const activeChange = (e, cateId) => {
active.value = e;
categoryId.value = cateId;
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
api.noticePage({ pageNo, pageSize, type: active.value, categoryId: categoryId.value })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
const back = () => {
uni.navigateBack();
};
</script>
<style lang="scss" scoped>
.notice {
&_block {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 35rpx;
width: 690rpx;
height: 106rpx;
background: #ffffff;
border-radius: 16rpx;
position: relative;
font-weight: 400;
font-size: 24rpx;
color: #232323;
}
/* 导航标签样式 */
.nav-tabs {
display: flex;
/* justify-content: space-around; */
background-color: #ffffff;
padding: 24rpx 0;
border-bottom: 1rpx solid #eee;
}
.tab-item {
font-size: 15px;
color: #999;
position: relative;
padding: 0 10px;
z-index: 9;
}
.tab-item.active {
color: #333;
font-weight: bold;
}
.tab-item.active::after {
content: '';
position: absolute;
bottom: 0rpx;
right: 20rpx;
width: 40rpx;
height: 12rpx;
background: #627c54;
border-radius: 24rpx 24rpx 24rpx 24rpx;
z-index: 5;
opacity: 0.8;
}
}
</style>

View File

@@ -0,0 +1,536 @@
<template>
<view class="container">
<!-- 顶部导航 -->
<wd-navbar title="下单" :bordered="false" left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<!-- 收货地址 -->
<view class="address-card" @click="selectAddress">
<view class="address-content">
<view v-if="address" class="address-text">
<view class="province-city">{{ address.receiverArea }} {{ address.receiverAddress }}</view>
<view class="address-detail">{{ address.receiverName }} {{ address.receiverPhone }}</view>
</view>
<view class="address-text" v-else>请选择地址</view>
<view class="arrow-right">
<image src="/static/y.png" style="width: 45rpx; height: 45rpx"></image>
</view>
</view>
</view>
<!-- 商品列表 -->
<view class="product-section">
<view class="section-title">商品信息</view>
<view class="product-list">
<view class="product-item" @click="viewProduct">
<!-- src="/images/product.jpg" -->
<image class="product-image" :src="goods.cover" mode="aspectFill"></image>
<view class="product-info">
<view class="product-name">{{ goods.name }}</view>
<view class="product-count">{{ goods.specs }}</view>
<view style="font-size: 36rpx; font-weight: bold; color: #ff2929">{{ goods.currentPrice }}</view>
</view>
</view>
<view class="arrow-right">
<image src="/static/y.png" style="width: 45rpx; height: 45rpx"></image>
</view>
</view>
<view class="price-item" style="margin-top: 25rpx">
<text class="price-label">商品数量</text>
<view class="price-value">
<wd-input-number v-model="dataFrom.goodsNum" />
</view>
</view>
</view>
<!-- 价格明细 -->
<!-- <view class="price-section">
<view class="section-title">价格明细</view>
<view class="price-item">
<text class="price-label">商品金额</text>
<text class="price-value" style="color: #ff2929">¥ {{ goods.currentPrice }}</text>
</view>
<view class="price-item">
<text class="price-label">商品数量</text>
<view class="price-value">
<wd-input-number v-model="GoodsNum" />
</view>
</view>
<view class="price-total">
<text class="price-label">合计</text>
<text class="price-value total">¥ {{ goods.currentPrice * GoodsNum }}</text>
</view>
</view> -->
<!-- 订单备注 -->
<view class="remark-section">
<view class="section-title">订单备注</view>
<view class="remark-content">
<wd-textarea style="height: 100rpx" v-model="dataFrom.note" placeholder="请填写订单备注" />
</view>
</view>
<!-- 抵扣 -->
<view class="price-section">
<view class="section-title">支付方式</view>
<view class="price-item-pay" :class="dataFrom.payType == 1 ? 'active-border' : ''" @click="changePayType(1)">
<view style="width: 350rpx; text-align: center" class="price-label">余额支付</view>
<view style="width: 1rpx; background-color: #f7f7f7; height: 30rpx"></view>
<view style="width: 350rpx; color: #ff2929; text-align: center" class="price-value">
<text style="color: #aaa">可用余额</text>
{{ userInfo.money || 0 }}
</view>
</view>
<view class="price-item" style="margin-top: 25rpx" v-if="dataFrom.payType == 1">
<view style="color: #aaa; font-size: 24rpx">
当前权益等级{{ userInfo.userRights.rights.rightsName }}
<text style="margin-left: 30rpx">
可享受折扣
<text style="color: #ff2929">{{ userInfo.userRights.rights.rightsDiscount / 10 }}</text>
</text>
</view>
</view>
<view class="price-item-pay" :class="dataFrom.payType == 2 ? 'active-border' : ''" @click="changePayType(2)">
<view style="width: 350rpx; text-align: center" class="price-label">权益货值</view>
<view style="width: 1rpx; background-color: #f7f7f7; height: 30rpx"></view>
<view style="width: 350rpx; color: #ff2929; text-align: center" class="price-value">
<text style="color: #aaa">可用抵扣</text>
{{ userInfo.userRights.pice || 0 }}
</view>
</view>
<view class="price-item" style="margin-top: 25rpx" v-if="dataFrom.payType == 2">
<view style="color: #aaa; font-size: 24rpx">提示抵扣金额不足时自动使用余额补足</view>
</view>
<view class="price-item-pay" style="flex-direction: column" :class="dataFrom.payType == 3 ? 'active-border' : ''" @click="changePayType(3)">
<view style="display: flex; align-items: center; justify-content: space-between">
<view style="width: 350rpx; text-align: center" class="price-label">混合支付</view>
<view style="width: 1rpx; background-color: #f7f7f7; height: 30rpx"></view>
<view v-if="dataFrom.payType == 3">
<view
style="width: 350rpx; color: #ff2929; text-align: center"
class="price-value"
v-if="goods.currentPrice * dataFrom.goodsNum > userInfo.userRights.pice + userInfo.money"
>
<view>
<text style="color: #aaa">余额</text>
<text v-if="goods.currentPrice * dataFrom.goodsNum - userInfo.userRights.pice > userInfo.money">
{{userInfo.money}}
</text>
<text v-else>
{{ goods.currentPrice * dataFrom.goodsNum - userInfo.userRights.pice }}
</text>
</view>
<view>
<text style="color: #aaa">抵扣</text>
<text v-if="goods.currentPrice * dataFrom.goodsNum - userInfo.money > userInfo.userRights.pice">
{{userInfo.userRights.pice}}
</text>
<text v-else>
{{ goods.currentPrice * dataFrom.goodsNum - userInfo.money }}
</text>
</view>
</view>
<view
style="width: 350rpx; color: #ff2929; text-align: center"
class="price-value"
v-if="goods.currentPrice * dataFrom.goodsNum < userInfo.userRights.pice + userInfo.money"
>
<view v-if="goods.currentPrice * dataFrom.goodsNum - userInfo.userRights.pice < 0">
<text style="color: #aaa">余额</text>
{{ 0 }}
</view>
<view v-else>
<text style="color: #aaa">余额</text>
{{ goods.currentPrice * dataFrom.goodsNum - userInfo.userRights.pice }}
</view>
<view>
<text style="color: #aaa">抵扣</text>
{{ goods.currentPrice * dataFrom.goodsNum < userInfo.userRights.pice ? goods.currentPrice * dataFrom.goodsNum : userInfo.userRights.pice }}
</view>
</view>
</view>
<view v-else>
<text style="color: #aaa">-</text>
</view>
</view>
</view>
<view class="price-item" style="margin-top: 25rpx" v-if="dataFrom.payType == 3">
<view style="color: #aaa; font-size: 24rpx">提示混合支付时优先使用抵扣金额</view>
</view>
<!-- <view class="price-section">
<view class="price-item">
<text class="price-label">商品金额</text>
<text class="price-value" style="color: #ff2929">¥ {{ goods.currentPrice }}</text>
</view>
</view> -->
<!-- <view class="price-item">
<view class="price-label">是否使用抵扣金额</view>
<view>
<wd-radio-group shape="dot" inline v-model="typePay">
<wd-radio :value="1" :disabled="!userInfo.userRights"></wd-radio>
<wd-radio :value="2"></wd-radio>
</wd-radio-group>
</view>
</view>
<view class="price-item">
<text class="price-label">当前余额</text>
<text class="price-value" style="color: #ff2929">¥ {{ userInfo.money || 0 }}</text>
</view>
<view class="price-item">
<text class="price-label">当前抵扣金额</text>
<text class="price-value" style="color: #ff2929">¥ {{ userInfo.userRights.pice || 0 }}</text>
</view>
<view class="price-item">
<text class="price-label">可抵扣金额</text>
<text class="price-value" style="color: #ff2929">¥ {{ userInfo.userRights.pice || 0 }}</text>
</view> -->
</view>
<view style="height: 130rpx"></view>
<!-- 底部结算栏 -->
<view class="footer">
<view class="total-price">
合计
<text style="color: #ff2929" v-if="dataFrom.payType == 1">¥ {{ (goods.currentPrice * dataFrom.goodsNum * userInfo.userRights.rights.rightsDiscount) / 100 }}</text>
<text style="color: #ff2929" v-if="dataFrom.payType == 2">¥ {{ goods.currentPrice * dataFrom.goodsNum }}</text>
<text style="color: #ff2929" v-if="dataFrom.payType == 3">¥ {{ goods.currentPrice * dataFrom.goodsNum }}</text>
</view>
<view class="pay-button" @click="submitOrder">确认支付</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { toast } from '@/utils/fun.js';
import api from '@/api/index';
import { Store } from '@/store';
const store = Store();
const userInfo = computed(() => {
if (!store.userInfo.userRights) {
dataFrom.value.payType = 2;
}
return (
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
},
userRights: null
}
);
});
const goods = ref({});
const address = ref(null);
const dataFrom = ref({
goodsId: null,
goodsNum: 1,
totalAmount: 0,
payableAmount: 0,
payAmount: 0,
payType: 1,
receiverId: null,
note: '',
orderType: 1
});
const submitOrder = () => {
//余额支付
if (dataFrom.value.payType == 1) {
//存在权益包
if (userInfo.value.userRights) {
if ((goods.value.currentPrice * dataFrom.value.goodsNum * userInfo.value.userRights.rights.rightsDiscount) / 100 > userInfo.value.money) {
toast('当前可用余额不足');
return;
}
dataFrom.value.payAmount = (goods.value.currentPrice * dataFrom.value.goodsNum * userInfo.value.userRights.rights.rightsDiscount) / 100;
dataFrom.value.payableAmount = dataFrom.value.payAmount;
dataFrom.value.totalAmount = goods.value.currentPrice * dataFrom.value.goodsNum;
}
}
// 权益包支付
if (dataFrom.value.payType == 2) {
//判断权益包货值是否大于总金额
if (goods.value.currentPrice * dataFrom.value.goodsNum > userInfo.value.userRights.pice) {
// 判断权益货值+余额是否>商品总价 >走混合支付
console.log(goods.value.currentPrice * dataFrom.value.goodsNum);
console.log(userInfo.value.userRights.pice + userInfo.value.money);
console.log(goods.value.currentPrice * dataFrom.value.goodsNum > userInfo.value.userRights.pice + userInfo.value.money);
if (goods.value.currentPrice * dataFrom.value.goodsNum < userInfo.value.userRights.pice + userInfo.value.money) {
uni.showModal({
title: '提示',
content: '当前货值不足,是否使用余额补足?',
success: (res) => {
if (res.confirm) {
}
}
});
} else {
toast('当前权益货值不足');
}
return;
}
}
api.orderCreate(dataFrom.value).then((res: any) => {
uni.navigateTo({
url: '/pages/order/success?id=' + res.id
});
});
};
onLoad(async (options: any) => {
dataFrom.value.goodsId = options.id;
await store.usersGetInfo();
api.goodsInfo({ id: options.id }).then((res: any) => {
goods.value = res;
});
api.addressPage({ isDefault: 1 }).then((res: any) => {
if (res.list.length !== 0) {
address.value = res.list[0];
// 赋值默认收货地址;
dataFrom.value.receiverId = address.value.id;
}
});
uni.$on('address', (e) => {
address.value = e;
});
});
const selectAddress = () => {
uni.navigateTo({
url: '/pages/address/list?type=1'
});
};
const viewProduct = () => {
uni.navigateTo({
url: '/pages/goods/goods?id=' + goods.value.id
});
};
const changePayType = (e = 1) => {
dataFrom.value.payType = e;
};
const back = () => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
.container {
display: flex;
flex-direction: column;
background-color: #f5f5f5;
position: relative;
}
/* 地址卡片 */
.address-card {
margin: 25rpx;
margin-bottom: 0;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
}
.address-content {
display: flex;
justify-content: space-between;
align-items: center;
}
.address-text {
flex: 1;
}
.province-city {
font-size: 15px;
margin-bottom: 5px;
}
.address-detail {
font-size: 14px;
color: #666;
}
.arrow-right {
color: #ccc;
font-size: 18px;
}
/* 商品部分 */
.product-section {
margin: 25rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 0;
}
.section-title {
font-size: 15px;
color: #333;
margin-bottom: 15px;
font-weight: 500;
}
.product-list {
display: flex;
justify-content: space-between;
align-items: center;
}
.product-item {
display: flex;
align-items: center;
}
.product-image {
width: 80px;
height: 80px;
border-radius: 4px;
margin-right: 10px;
}
.product-info {
flex: 1;
}
.product-name {
font-size: 14px;
margin-bottom: 5px;
}
.product-count {
font-size: 13px;
color: #999;
margin: 10rpx 0;
}
/* 价格明细 */
.price-section {
margin: 25rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 0;
}
.price-item {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
}
.price-item-pay {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15rpx;
padding: 24rpx 0rpx;
border: 1rpx solid #f7f7f7;
border-radius: 10rpx;
background-color: #f7f7f7;
}
.price-total {
display: flex;
align-items: center;
justify-content: space-between;
}
.price-label {
font-size: 14px;
color: #333;
}
.price-value {
font-size: 14px;
color: #333;
}
.total {
color: #ff2929;
font-weight: 500;
}
/* 订单备注 */
.remark-section {
margin: 25rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 0;
}
.remark-content {
border-radius: 16rpx;
border: 1rpx solid #f7f7f7;
overflow: hidden;
height: 100rpx;
}
/* 底部结算栏 */
.footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
height: 100rpx;
padding: 0 30rpx;
background-color: #fff;
border-top: 1rpx solid #eee;
}
.total-price {
font-size: 15px;
color: #333;
}
.pay-button {
background-color: #799675;
color: #fff;
font-size: 16px;
padding: 0 30px;
height: 36px;
line-height: 36px;
border-radius: 18px;
}
.active-border {
background-color: rgba(121, 150, 117, 0.1);
border: 1rpx solid #799675;
.price-label {
color: #799675;
}
}
</style>

501
pages/order/confirm.vue Normal file
View File

@@ -0,0 +1,501 @@
<template>
<view class="container">
<!-- 顶部导航 -->
<wd-navbar title="下单" :bordered="false" left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<!-- 收货地址 -->
<view class="address-card" @click="selectAddress">
<view class="address-content">
<view v-if="address" class="address-text">
<view class="province-city">{{ address.receiverArea }} {{ address.receiverAddress }}</view>
<view class="address-detail">{{ address.receiverName }} {{ address.receiverPhone }}</view>
</view>
<view v-else class="address-text">请选择地址</view>
<view class="arrow-right">
<image src="/static/y.png" style="width: 45rpx; height: 45rpx"></image>
</view>
</view>
</view>
<!-- 商品列表 -->
<view class="product-section">
<view class="section-title">商品信息</view>
<view class="product-list">
<view class="product-item" @click="viewProduct">
<image class="product-image" :src="goods.cover" mode="aspectFill"></image>
<view class="product-info">
<view class="product-name">{{ goods.name }}</view>
<view class="product-spec">{{ goods.specs }}</view>
<view class="product-price">{{ goods.currentPrice }}</view>
</view>
</view>
<view class="arrow-right">
<image src="/static/y.png" style="width: 45rpx; height: 45rpx"></image>
</view>
</view>
<view class="price-item" style="margin-top: 25rpx">
<text class="price-label">商品数量</text>
<view class="price-value">
<wd-input-number v-model="dataFrom.goodsNum" />
</view>
</view>
</view>
<!-- 订单备注 -->
<view class="remark-section">
<view class="section-title">订单备注</view>
<view class="remark-content">
<wd-textarea style="height: 100rpx" v-model="dataFrom.note" placeholder="请填写订单备注" />
</view>
</view>
<!-- 支付方式 -->
<view class="price-section">
<view class="section-title">支付方式</view>
<!-- 余额支付 -->
<view class="price-item-pay" :class="{ 'active-border': dataFrom.payType === 1 }" @click="dataFrom.payType = 1">
<view style="width: 350rpx; text-align: center" class="price-label">余额支付</view>
<view style="width: 1rpx; background-color: #f7f7f7; height: 30rpx"></view>
<view style="width: 350rpx; color: #ff2929; text-align: center" class="price-value">
<text style="color: #aaa">可用余额</text>
{{ userInfo.money || 0 }}
</view>
</view>
<view v-if="dataFrom.payType === 1 && userInfo.userRights" class="price-item">
<view style="color: #aaa; font-size: 24rpx">
当前权益等级{{ userInfo.userRights.rights.rightsName }}
<text style="margin-left: 30rpx">
可享受折扣
<text style="color: #ff2929">{{ userInfo.userRights.rights.rightsDiscount / 10 }}</text>
</text>
</view>
</view>
<!-- 权益货值支付 -->
<view class="price-item-pay" v-if="userInfo.userRights" :class="{ 'active-border': dataFrom.payType === 2 }" @click="dataFrom.payType = 2">
<view style="width: 350rpx; text-align: center" class="price-label">权益货值</view>
<view style="width: 1rpx; background-color: #f7f7f7; height: 30rpx"></view>
<view style="width: 350rpx; color: #ff2929; text-align: center" class="price-value">
<text style="color: #aaa">可用抵扣</text>
{{ userInfo.userRights.pice || 0 }}
</view>
</view>
<view v-if="dataFrom.payType === 2" class="price-item">
<view style="color: #aaa; font-size: 24rpx">提示抵扣金额不足时自动使用余额补足</view>
</view>
<!-- 混合支付 -->
<view class="price-item-pay" :class="{ 'active-border': dataFrom.payType === 3 }" @click="dataFrom.payType = 3" v-if="userInfo.userRights">
<view style="display: flex; align-items: center; justify-content: space-between; width: 100%">
<view style="width: 350rpx; text-align: center" class="price-label">混合支付</view>
<view style="width: 1rpx; background-color: #f7f7f7; height: 30rpx"></view>
<view style="width: 350rpx; color: #ff2929; text-align: center" class="price-value">
<view v-if="totalAmount > userInfo.userRights.pice + userInfo.money">
<view>
<text style="color: #aaa">余额</text>
{{ min(userInfo.money, totalAmount - userInfo.userRights.pice) }}
</view>
<view>
<text style="color: #aaa">抵扣</text>
{{ min(userInfo.userRights.pice, totalAmount - userInfo.money) }}
</view>
</view>
<view v-else>
<view>
<text style="color: #aaa">余额</text>
{{ max(0, totalAmount - userInfo.userRights.pice) }}
</view>
<view v-if="min(totalAmount - (totalAmount - userInfo.userRights.pice), userInfo.userRights.pice) > totalAmount">
<text style="color: #aaa">抵扣</text>
{{ totalAmount }}
</view>
<view v-else>
<text style="color: #aaa">抵扣</text>
{{ min(totalAmount - (totalAmount - userInfo.userRights.pice), userInfo.userRights.pice) }}
</view>
</view>
</view>
</view>
</view>
<view v-if="dataFrom.payType === 3" class="price-item">
<view style="color: #aaa; font-size: 24rpx">提示混合支付时优先使用抵扣金额</view>
</view>
</view>
<view style="height: 130rpx"></view>
<!-- 底部结算栏 -->
<view class="footer">
<view class="total-price">
合计
<text style="color: #ff2929">{{ formatPrice(paymentAmount) }}</text>
</view>
<view class="pay-button" @click="submitOrder">确认支付</view>
</view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { toast } from '@/utils/fun.js';
import api from '@/api/index';
import { Store } from '@/store';
const store = Store();
// 用户信息
const userInfo = computed(() => {
if (!store.userInfo.userRights) {
dataFrom.value.payType = 1;
}
return (
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: { balance: 0 },
userRights: null
}
);
});
// 商品信息
const goods = ref({});
const address = ref(null);
// 表单数据
const dataFrom = ref({
goodsId: null,
goodsNum: 1,
totalAmount: 0,
payableAmount: 0,
payAmount: 0,
payType: 1,
receiverId: null,
note: '',
orderType: 1
});
// 计算总金额
const totalAmount = computed(() => {
return goods.value.currentPrice * dataFrom.value.goodsNum;
});
// 计算实际支付金额
const paymentAmount = computed(() => {
if (dataFrom.value.payType === 1) {
const discount = userInfo.value.userRights?.rights?.rightsDiscount || 100;
return (totalAmount.value * discount) / 100;
}
return totalAmount.value;
});
// 提交订单
const submitOrder = () => {
let data = JSON.parse(JSON.stringify(dataFrom.value));
if (!address.value) {
uni.showToast({
title: '请选择收货地址',
icon: 'none'
});
return;
}
uni.showLoading({
mask: true
});
// 设置收货地址
data.receiverId = address.value?.id;
if (data.payType == 1) {
// 设置支付金额
data.payAmount = paymentAmount.value;
data.totalAmount = totalAmount.value;
data.payableAmount = paymentAmount.value;
data.totalAmount = totalAmount.value;
}
if (data.payType == 2) {
// 设置抵扣金额
data.deductibleAmount = totalAmount.value;
data.totalAmount = totalAmount.value;
data.deductionAmount = totalAmount.value;
data.totalAmount = totalAmount.value;
}
if (data.payType == 3) {
if (userInfo.value.userRights.pice < totalAmount.value) {
data.deductibleAmount = userInfo.value.userRights.pice;
data.deductionAmount = userInfo.value.userRights.pice;
data.payAmount = totalAmount.value - userInfo.value.userRights.pice;
data.payableAmount = totalAmount.value - userInfo.value.userRights.pice;
data.totalAmount = totalAmount.value;
} else {
// 设置抵扣金额
data.deductibleAmount = totalAmount.value;
data.totalAmount = totalAmount.value;
data.deductionAmount = totalAmount.value;
data.totalAmount = totalAmount.value;
data.payType = 2;
}
}
api.orderCreate(data)
.then((res) => {
uni.hideLoading();
uni.navigateTo({
url: '/pages/order/success?id=' + res
});
})
.catch(() => {
uni.hideLoading();
});
};
// 加载数据
onLoad(async (options) => {
dataFrom.value.goodsId = options.id;
await store.usersGetInfo();
api.goodsInfo({ id: options.id }).then((res) => {
goods.value = res;
});
api.addressPage({ isDefault: 1 }).then((res) => {
if (res.list.length) {
address.value = res.list[0];
dataFrom.value.receiverId = address.value.id;
}
});
uni.$on('address', (e) => {
address.value = e;
});
});
// 工具函数
const min = (a, b) => Math.min(a, b);
const max = (a, b) => Math.max(a, b);
const formatPrice = (price) => `¥ ${parseFloat(price).toFixed(2)}`;
// 其他方法
const selectAddress = () => {
uni.navigateTo({
url: '/pages/address/list?type=1'
});
};
const viewProduct = () => {
uni.navigateTo({
url: '/pages/goods/goods?id=' + goods.value.id
});
};
const back = () => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
.container {
display: flex;
flex-direction: column;
background-color: #f5f5f5;
position: relative;
}
.address-card {
margin: 25rpx;
margin-bottom: 0;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
}
.address-content {
display: flex;
justify-content: space-between;
align-items: center;
}
.address-text {
flex: 1;
}
.province-city {
font-size: 15px;
margin-bottom: 5px;
}
.address-detail {
font-size: 14px;
color: #666;
}
.arrow-right {
color: #ccc;
font-size: 18px;
}
.product-section {
margin: 25rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 0;
}
.section-title {
font-size: 15px;
color: #333;
margin-bottom: 15px;
font-weight: 500;
}
.product-list {
display: flex;
justify-content: space-between;
align-items: center;
}
.product-item {
display: flex;
align-items: center;
}
.product-image {
width: 80px;
height: 80px;
border-radius: 4px;
margin-right: 10px;
}
.product-info {
flex: 1;
}
.product-name {
font-size: 14px;
margin-bottom: 5px;
}
.product-spec {
font-size: 13px;
color: #999;
margin: 10rpx 0;
}
.product-price {
font-size: 36rpx;
font-weight: bold;
color: #ff2929;
}
.price-section {
margin: 25rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 0;
}
.price-item {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
}
.price-item-pay {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15rpx;
padding: 24rpx 0rpx;
border: 1rpx solid #f7f7f7;
border-radius: 10rpx;
background-color: #f7f7f7;
}
.price-total {
display: flex;
align-items: center;
justify-content: space-between;
}
.price-label {
font-size: 14px;
color: #333;
}
.price-value {
font-size: 14px;
color: #333;
}
.total {
color: #ff2929;
font-weight: 500;
}
.remark-section {
margin: 25rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 0;
}
.remark-content {
border-radius: 16rpx;
border: 1rpx solid #f7f7f7;
overflow: hidden;
height: 100rpx;
}
.footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
height: 100rpx;
padding: 0 30rpx;
background-color: #fff;
border-top: 1rpx solid #eee;
}
.total-price {
font-size: 15px;
color: #333;
}
.pay-button {
background-color: #799675;
color: #fff;
font-size: 16px;
padding: 0 30px;
height: 36px;
line-height: 36px;
border-radius: 18px;
}
.active-border {
background-color: rgba(121, 150, 117, 0.1);
border: 1rpx solid #799675;
.price-label {
color: #799675;
}
}
</style>

344
pages/order/order.vue Normal file
View File

@@ -0,0 +1,344 @@
<template>
<view class="container">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<!-- z-paging默认铺满全屏此时页面所有view都应放在z-paging标签内否则会被盖住 -->
<!-- 需要固定在页面顶部的view请通过slot="top"插入包括自定义的导航栏 -->
<!--
<view slot="top">
</view> -->
<!-- 订单列表 -->
<wd-navbar title="订单" safeAreaInsetTop></wd-navbar>
<!-- 顶部导航栏 -->
<view class="nav-tabs">
<!-- 订单状态0 - 待付款1 - 已完成2 - 已取消,示例值(2) -->
<view class="tab-item" :class="queryFrom.orderStatus === '' ? 'active' : ''" @click="changeStatus('')">全部</view>
<view class="tab-item" :class="queryFrom.orderStatus === 0 ? 'active' : ''" @click="changeStatus(0)">待付款</view>
<view class="tab-item" :class="queryFrom.orderStatus == 1 ? 'active' : ''" @click="changeStatus(1)">已完成</view>
<view class="tab-item" :class="queryFrom.orderStatus == 2 ? 'active' : ''" @click="changeStatus(2)">已取消</view>
</view>
<view class="order-list">
<!-- 订单项1 - 待付款 -->
<view class="order-item" v-for="(item, index) in dataList" :key="index">
<view class="order-header">
<text class="order-id">{{ item.orderNo }}</text>
<text class="order-status pending" v-if="item.orderStatus === 0">待付款</text>
<text class="order-status completed" v-if="item.orderStatus == 1">已完成</text>
</view>
<view class="order-content">
<image class="product-image" :src="item.goods.cover" mode="aspectFill"></image>
<view class="product-info">
<view class="product-name">
<view>{{ item.goods.name }}</view>
</view>
<view class="product-spec">
<view>{{ item.goods.specs }}</view>
<view class="product-count">×{{ item.goodsNum }}</view>
</view>
<view class="product-price">
<view style="font-size: 26rpx" v-if="item.deductionAmount">已抵扣金额{{ item.deductionAmount }}</view>
<view v-else></view>
<text style="font-weight: bold">¥{{ item.payableAmount }}</text>
</view>
</view>
</view>
<view class="order-footer">
<view class="order-time">{{ timeFormat(item.createTime, 'yyyy-MM-dd hh:mm:ss') }}</view>
<view class="order-actions">
<!-- <view class="btn-cancel">取消订单</view> -->
<!-- <view class="btn-pay">去支付</view> -->
<view class="btn-buy-again" v-if="item.orderStatus == 1" @click="toGoods(item.goodsId)">再次购买</view>
</view>
</view>
</view>
<!-- <view class="order-item">
<view class="order-header">
<text class="order-id">GMZST202506040001</text>
<text class="order-status completed">已完成</text>
</view>
<view class="order-content">
<image class="product-image" src="/static/product.jpg" mode="aspectFill"></image>
<view class="product-info">
<view class="product-name">方愈苗药皮毒清软膏</view>
<view class="product-spec">12/</view>
</view>
<view class="product-count">×230000</view>
<view class="product-price">¥50w</view>
</view>
<view class="order-footer">
<view class="order-time">2025-10-09 19:43:57</view>
<view class="order-actions">
<view class="btn-reorder">再来一单</view>
</view>
</view>
</view>
<view class="order-item">
<view class="order-header">
<text class="order-id">GMZST202506040001</text>
<text class="order-status cancelled">已取消</text>
</view>
<view class="order-content">
<image class="product-image" src="/static/product.jpg" mode="aspectFill"></image>
<view class="product-info">
<view class="product-name">方愈苗药皮毒清软膏</view>
<view class="product-spec">12/</view>
</view>
<view class="product-count">×320000</view>
<view class="product-price">¥10w</view>
</view>
<view class="order-footer">
<view class="order-time">2025-10-09 19:43:57</view>
<view class="order-actions">
</view>
</view>
</view> -->
</view>
</z-paging>
</view>
</template>
<script setup lang="ts">
import api from '@/api/index';
import { ref } from 'vue';
import { timeFormat } from '@/utils/fun.js';
const paging = ref(null);
// v-model绑定的这个变量不要在分页请求结束中自己赋值直接使用即可
const dataList = ref([]);
const queryFrom = ref({
orderType: 1,
payStatus: '',
orderStatus: ''
});
const changeStatus = (e) => {
queryFrom.value.orderStatus = e;
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
api.orderPage({ pageNo, pageSize, ...queryFrom.value })
.then((res: any) => {
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
const toGoods = (e) => {
uni.navigateTo({
url: '/pages/goods/goods?id=' + e
});
};
</script>
<style scoped>
.container {
padding: 0;
background-color: #f5f5f5;
min-height: 100vh;
}
/* 导航标签样式 */
.nav-tabs {
display: flex;
/* justify-content: space-around; */
background-color: #ffffff;
padding: 24rpx 0;
border-bottom: 1rpx solid #eee;
}
.tab-item {
font-size: 15px;
color: #999;
position: relative;
padding: 0 10px;
z-index: 9;
}
.tab-item.active {
color: #333;
font-weight: bold;
}
.tab-item.active::after {
content: '';
position: absolute;
bottom: 0rpx;
right: 20rpx;
width: 40rpx;
height: 12rpx;
background: #627c54;
border-radius: 24rpx 24rpx 24rpx 24rpx;
z-index: 5;
opacity: 0.5;
}
/* 订单列表样式 */
.order-list {
padding: 10px;
}
.order-item {
background-color: #fff;
margin-bottom: 36rpx;
border-radius: 16rpx;
padding: 36rpx;
}
.order-header {
font-size: 28rpx;
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #eeeeee;
padding-bottom: 24rpx;
color: #232323;
}
.order-id {
font-size: 14px;
color: #333;
}
.order-status {
font-size: 14px;
font-weight: 500;
}
.pending {
color: #ff5722;
}
.completed {
color: #4caf50;
}
.cancelled {
color: #f44336;
}
.order-content {
display: flex;
padding: 20rpx 0;
}
.product-image {
width: 150rpx;
height: 150rpx;
border-radius: 8rpx;
margin-right: 20rpx;
background-color: #f0f0f0;
}
.product-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.product-name {
font-size: 28rpx;
color: #232323;
font-weight: 600;
display: flex;
align-items: center;
justify-content: space-between;
}
.product-spec {
font-size: 28rpx;
color: #666;
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.product-count {
font-size: 24rpx;
color: #232323;
text-align: right;
}
.product-price {
font-size: 36rpx;
color: #ff3d3d;
/* font-weight: bold; */
text-align: right;
display: flex;
align-items: center;
justify-content: space-between;
}
.order-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 0 0;
border-top: 1rpx solid #f5f5f5;
}
.order-time {
font-size: 24rpx;
color: #232323;
}
.order-actions {
display: flex;
gap: 10px;
}
.btn-cancel,
.btn-pay,
.btn-reorder,
.btn-buy-again {
width: 150rpx;
height: 56rpx;
border-radius: 28rpx;
/* border: 1rpx solid #999999; */
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
}
.btn-cancel {
border: 1rpx solid #999999;
color: #999;
}
.btn-pay {
color: #ff6f00;
border: 1rpx solid #ff6f00;
}
.btn-reorder {
color: #ffffff;
background-color: #458f3b;
border: none;
}
.btn-buy-again {
color: #ffffff;
background-color: #f44336;
border: none;
}
.btn-cancel:active,
.btn-pay:active,
.btn-reorder:active,
.btn-buy-again:active {
opacity: 0.8;
}
</style>

286
pages/order/success.vue Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

225
pages/team/team.vue Normal file
View File

@@ -0,0 +1,225 @@
<template>
<view>
<z-paging ref="paging" v-model="dataList" @query="queryList" :refresher-enabled="showLoading">
<view class="p30">
<view style="position: relative; width: 690rpx; height: 228rpx; padding: 30rpx 25rpx;box-shadow: 0rpx 2rpx 8rpx 2rpx rgba(0,88,219,0.06);border-radius: 16rpx;overflow: hidden;" v-if="userInfo.userRights && userInfo.userRights.rightsLevel == 3">
<image style="width: 690rpx; height: 228rpx; position: absolute; top: 0; left: 0; z-index: -1" src="/static/team.png"></image>
<view style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 30rpx">
<view style="font-size: 32rpx; font-weight: bold">
团队业绩奖励
<text style="font-weight: 500; font-size: 28rpx; color: #999">()</text>
</view>
<wd-datetime-picker type="year-month" v-model="value" @confirm="confirm" @close="showLoading = true" @open="showLoading = false">
<view style="font-size: 28rpx; font-weight: bold; color: #5d7a4e; display: flex; align-items: center">
11
<image src="/static/icons/yue.png" style="width: 34rpx; height: 34rpx"></image>
</view>
</wd-datetime-picker>
</view>
<view style="display: flex; align-items: center; justify-content: space-between; font-size: 26rpx; margin-bottom: 30rpx;">
<view>本月团队业绩{{ count.investmentAmount }}</view>
<view>{{ timeTrue ? '可' : '已' }}获得业绩奖励{{ count.expectedReturn }}</view>
</view>
<view style="font-size: 26rpx">
累计获得奖励
<text style="color: #fe3535">{{ count.totalExpectedReturn }}</text>
</view>
</view>
<view style="font-size: 30rpx; background-color: #fff; border-radius: 8rpx; padding: 25rpx; margin-bottom: 25rpx" v-if="userInfo.puser">
推荐人{{ userInfo.puser ? `${userInfo.puser.nickname} ${userInfo.puser.mobile}` : '' }}
</view>
<view style="font-weight: bold; font-size: 32rpx; margin: 30rpx 0">团队成员列表</view>
<!-- 用户信息卡片 -->
<view class="user-card" v-for="(item, index) in dataList" :key="index">
<!-- 头像区域 -->
<view class="avatar-container">
<image class="avatar" :src="item.avatar" mode="aspectFit"></image>
<view class="avatar-container_name">{{ item.nickname || '微信用户' }}</view>
</view>
<view style="display: flex; align-items: center; justify-content: space-between; margin-top: 20rpx">
<!-- 用户信息区域 -->
<view class="phone-time-row">
<view class="phone">{{ item.mobile }}</view>
<view class="time"><uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="item.createTime"></uni-dateformat></view>
</view>
<!-- 右侧操作区域 -->
<view class="action-section">
<view class="action-btn join" v-if="item.userRights">{{ item.userRights.rights.rightsName }}</view>
<view class="action-btn join" v-else></view>
<view class="level-text">当前等级</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { onShow, onLoad } from '@dcloudio/uni-app';
import api from '@/api/index';
import { timeFormat } from '@/utils/fun.js';
const paging = ref(null);
const dataList = ref([]);
const count = ref({});
const showLoading = ref(true);
const timeTrue = ref(false);
import { Store } from '@/store';
const store = Store();
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
onShow(() => {});
onLoad(() => {
timeTrue.value = isTimestampInCurrentMonth(new Date().getTime());
timeCount();
});
function timeCount() {
if (userInfo.value.userRights && userInfo.value.userRights.rightsLevel == 3) {
api.getTeamMonthlyPerformanceAward({ month: timeFormat(value.value, 'yyyy-MM-ddThh:mm:ss') }).then((res) => {
count.value = res;
});
}
}
const value = ref(new Date().getTime());
const list = ref({});
const queryList = (pageNo, pageSize) => {
api.usersGetInfoTeam({ pageNo, pageSize })
.then((res: any) => {
paging.value.complete(res.list);
timeCount();
})
.catch((res) => {
paging.value.complete(false);
});
};
const confirm = (e) => {
timeTrue.value = isTimestampInCurrentMonth(e.value);
paging.value.reload();
};
function isTimestampInCurrentMonth(timestamp) {
// 处理时间戳(支持秒级和毫秒级)
const ts = timestamp < 1e12 ? timestamp * 1000 : timestamp;
const date = new Date(ts);
// 获取当前日期信息
const now = new Date();
const currentYear = now.getFullYear();
const currentMonth = now.getMonth();
// 获取目标日期的年月
const targetYear = date.getFullYear();
const targetMonth = date.getMonth();
// 比较年月是否相同
return currentYear === targetYear && currentMonth === targetMonth;
}
// onShow(async () => {
// list.value = await api.usersGetInfoTeam();
// });
</script>
<style lang="scss" scoped>
.user-card {
border-radius: 16rpx;
width: 690rpx;
height: 244rpx;
background: #ffffff;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0rpx 2rpx 8rpx 2rpx rgba(0,88,219,0.06);
}
.avatar-container {
display: flex;
align-items: center;
&_name {
font-weight: bold;
font-size: 28rpx;
color: #232323;
}
.avatar {
width: 72rpx;
height: 72rpx;
border-radius: 50%;
margin-right: 20rpx;
background-color: #999;
}
}
.info-section {
flex: 1;
}
.username {
font-size: 36rpx;
color: #333333;
font-weight: 500;
margin-bottom: 20rpx;
display: block;
}
.phone-time-row {
margin-top: 10rpx;
}
.phone {
font-weight: 400;
font-size: 28rpx;
color: #232323;
}
.time {
margin-top: 20rpx;
font-weight: 400;
font-size: 24rpx;
color: #999;
}
.action-section {
display: flex;
flex-direction: column;
align-items: center;
}
.action-btn {
font-weight: bold;
font-size: 28rpx;
color: #5d7a4e;
margin-bottom: 4rpx;
}
.level-text {
margin-top: 20rpx;
font-weight: 400;
font-size: 24rpx;
color: #999;
}
</style>

124
pages/wallet/list.vue Normal file
View File

@@ -0,0 +1,124 @@
<template>
<view>
<wd-navbar title="我的账单" :bordered="false" left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<z-paging ref="paging" :refresher-enabled="showLoading" v-model="dataList" use-page-scroll @query="queryList">
<view class="p30">
<view>
<view style="display: flex; align-items: center; justify-content: space-between">
<image style="width: 74rpx; height: 34rpx" mode="widthFix" src="/static/icons/zhangdan.png"></image>
<wd-picker @close="showLoading = true" @open="showLoading = false" :columns="columns" v-model="queryPrams.bizType" use-default-slot @confirm="handleConfirm">
<view style="display: flex; align-items: center; font-size: 28rpx">
{{ typeName || '筛选' }}
<image style="margin-left: 15rpx; width: 35rpx; height: 35rpx" src="/static/icons/xia.png"></image>
</view>
</wd-picker>
</view>
<view class="wall_list" v-for="(item, index) in dataList" :key="index">
<view>
<view style="margin-bottom: 25rpx; font-size: 28rpx">{{ item.title }}</view>
<view style="font-size: 24rpx; color: #999">
{{ timeFormat(item.createTime, 'yyyy-MM-dd hh:mm:ss') }}
</view>
</view>
<view style="font-size: 32rpx; font-weight: bold; color: #799675">{{ item.money }}</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import api from '@/api/index';
import { Store } from '@/store';
const store = Store();
const paging = ref(null);
const dataList = ref([]);
const columns = ref([]);
const showLoading = ref(true);
const typeName = ref('');
const queryPrams = ref({
bizType: ''
});
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
import { timeFormat } from '@/utils/fun.js';
const queryList = (pageNo, pageSize) => {
api.moneyRecord({ pageNo, pageSize, ...queryPrams.value })
.then((res: any) => {
columns.value = Object.entries(res.bizType).map(([value, label]) => ({
value,
label
}));
columns.value.unshift({
label: '全部',
value: ''
});
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
const handleConfirm = (e) => {
if (!e.value) {
typeName.value = '';
} else {
typeName.value = e.selectedItems.label;
}
paging.value.reload();
};
const back = () => {
uni.navigateBack();
};
</script>
<style lang="scss" scoped>
.block_wall {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
&_tit {
display: flex;
align-items: center;
}
}
.wall_list {
width: 690rpx;
height: 118rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 8rpx 2rpx rgba(0, 88, 219, 0.06);
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
margin-top: 30rpx;
}
</style>

329
pages/wallet/wallet.vue Normal file
View File

@@ -0,0 +1,329 @@
<template>
<view>
<z-paging ref="paging" :refresher-enabled="showLoading" v-model="dataList" @query="queryList">
<wd-navbar title="钱包" :bordered="false" left-arrow custom-style="background-color: transparent !important;" safeAreaInsetTop @click-left="back"></wd-navbar>
<view class="p30">
<image src="/static/qianBeiAs.png" mode="widthFix" style="position: absolute; top: 0; left: 0; width: 100%; z-index: -1"></image>
<view style="position: relative">
<image src="/static/qianbaoBei.png" style="width: 690rpx; height: 382rpx; position: absolute; top: 0; left: 0; z-index: -1"></image>
<view style="padding: 24rpx 30rpx; font-size: 36rpx; font-weight: bold; margin-bottom: 24rpx">我的钱包</view>
<view style="display: flex; align-items: center; margin-bottom: 14rpx; padding: 0 30rpx">
<!-- <image src="/static/icons/wen.png" style="width: 28rpx; height: 28rpx"></image> -->
<view style="font-size: 24rpx; color: #666a6d; margin: 0 10rpx">我的余额</view>
<image @click="toeas" :src="`/static/icons/yan${toeasTrue ? 's' : ''}.png`" style="width: 35rpx; height: 35rpx"></image>
</view>
<view
style="
font-size: 58rpx;
font-weight: bold;
color: #69a24a;
padding: 0 30rpx;
margin-bottom: 25rpx;
display: flex;
align-items: center;
justify-content: space-between;
"
>
{{ toeasTrue ? '****' : userInfo.money }}
<view
@click="toZhuan"
style="
color: #8ec287;
padding: 8rpx 30rpx;
border-radius: 30rpx;
font-size: 28rpx;
background-color: rgba(255, 255, 255, 0.8);
font-weight: 400;
display: flex;
align-items: center;
"
>
<image src="/static/icons/huazhuan.png" style="width: 35rpx; height: 35rpx"></image>
<text style="margin-left: 10rpx">划转</text>
</view>
</view>
<view
style="
width: 690rpx;
height: 110rpx;
background: #e9f2e7;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
margin-bottom: 35rpx;
"
>
<view class="block_wall">
<view class="block_wall_tit" style="font-size: 24rpx">
<view>业绩奖励</view>
<!-- <image src="/static/icons/wen.png" style="width: 28rpx; height: 28rpx"></image> -->
</view>
<view style="font-size: 32rpx; font-weight: bold">{{ userInfo.performanceReward || 0 }}</view>
</view>
<view class="block_wall">
<view class="block_wall_tit" style="font-size: 24rpx">
<view>直推奖励</view>
<!-- <image src="/static/icons/wen.png" style="width: 28rpx; height: 28rpx"></image> -->
</view>
<view style="font-size: 32rpx; font-weight: bold">{{ userInfo.directReferralReward || 0 }}</view>
</view>
<view class="block_wall">
<view class="block_wall_tit" style="font-size: 24rpx">
<view>间推奖励</view>
<!-- <image src="/static/icons/wen.png" style="width: 28rpx; height: 28rpx"></image> -->
</view>
<view style="font-size: 32rpx; font-weight: bold">{{ userInfo.indirectReferralReward || 0 }}</view>
</view>
<view class="block_wall">
<view class="block_wall_tit" style="font-size: 24rpx">
<view>特殊奖励</view>
<!-- <image src="/static/icons/wen.png" style="width: 28rpx; height: 28rpx"></image> -->
</view>
<view style="font-size: 32rpx; font-weight: bold">{{ userInfo.specialReward || 0 }}</view>
</view>
</view>
</view>
<!-- 报单业绩 -->
<view class="wallet-section" v-if="userInfo.branchCompany">
<view class="section-title">
<view>
<text>市场报单业绩</text>
<text style="font-size: 24rpx; font-weight: 500">(</text>
<image src="/static/icons/wen.png" @click="tishi" style="width: 28rpx; height: 28rpx"></image>
</view>
<view style="font-size: 26rpx">合计{{ rewardReportInfo.total_monthly_performance }}</view>
</view>
<view class="wallet-cards">
<view class="wallet-item" v-for="(item, index) in rewardReportInfo.money_count" :key="index">
<text class="amount red">{{ item.money || 0 }}</text>
<text class="label">{{ item.name }}</text>
<text class="desc">已招募{{ item.count || 0 }}</text>
</view>
<!-- <view class="wallet-item">
<text class="amount">{{ userInfo.performanceReward || 0 }}</text>
<text class="label">总代理</text>
<text class="desc">已招募{{ rewardReportInfo.money_count.generalAgent || 0 }}</text>
</view>
<view class="wallet-item">
<text class="amount">{{ userInfo.directReferralReward || 0 }}</text>
<text class="label">加盟店</text>
<text class="desc">已招募{{ rewardReportInfo.money_count.franchise || 0 }}</text>
</view> -->
<view class="wallet-item">
<text class="amount">{{ rewardReportInfo.restock_reward || 0 }}</text>
<text class="label">团队补货</text>
</view>
</view>
</view>
<view>
<view style="display: flex; align-items: center; justify-content: space-between">
<image style="width: 74rpx; height: 34rpx" mode="widthFix" src="/static/icons/zhangdan.png"></image>
<wd-picker
@close="showLoading = true"
@open="showLoading = false"
:columns="columns"
v-model="queryPrams.bizType"
use-default-slot
@confirm="handleConfirm"
>
<view style="display: flex; align-items: center; font-size: 28rpx">
{{ typeName || '筛选' }}
<image style="margin-left: 15rpx; width: 35rpx; height: 35rpx" src="/static/icons/xia.png"></image>
</view>
</wd-picker>
</view>
<view class="wall_list" v-for="(item, index) in dataList" :key="index">
<view>
<view style="margin-bottom: 25rpx; font-size: 28rpx">{{ item.title }}</view>
<view style="font-size: 24rpx; color: #999">
{{ timeFormat(item.createTime, 'yyyy-MM-dd hh:mm:ss') }}
</view>
</view>
<view style="font-size: 32rpx; font-weight: bold; color: #799675">{{ item.money }}</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import api from '@/api/index';
import { Store } from '@/store';
import { onShow } from '@dcloudio/uni-app';
const rewardReportInfo = ref({});
const store = Store();
const paging = ref(null);
const dataList = ref([]);
const columns = ref([]);
const showLoading = ref(true);
const typeName = ref('');
const toeasTrue = ref(false);
const queryPrams = ref({
bizType: ''
});
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
onShow(async () => {
if (userInfo.value.branchCompany) {
api.rewardReport().then((res) => {
rewardReportInfo.value = res;
});
}
});
import { timeFormat } from '@/utils/fun.js';
const queryList = (pageNo, pageSize) => {
api.moneyRecord({ pageNo, pageSize, ...queryPrams.value })
.then((res: any) => {
columns.value = Object.entries(res.bizType).map(([value, label]) => ({
value,
label
}));
columns.value.unshift({
label: '全部',
value: ''
});
paging.value.complete(res.list);
})
.catch((res) => {
paging.value.complete(false);
});
};
const handleConfirm = (e) => {
if (!e.value) {
typeName.value = '';
} else {
typeName.value = e.selectedItems.label;
}
paging.value.reload();
};
const back = () => {
uni.navigateBack();
};
const tishi = () => {
uni.showModal({
title: '提示',
content: '每月初结算上月业绩“团队补货”为团队补货回款本月整个团队总补货回款为20W则月度团队补货收益为20W×12%=24000元',
showCancel: false
});
};
const toeas = () => {
toeasTrue.value = !toeasTrue.value;
};
const toZhuan = () => {
uni.navigateTo({
url: '/pages/wallet/zhaun'
});
};
</script>
<style lang="scss" scoped>
.block_wall {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
&_tit {
display: flex;
align-items: center;
}
}
.wall_list {
width: 690rpx;
height: 118rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 8rpx 2rpx rgba(0, 88, 219, 0.06);
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
margin-top: 30rpx;
}
/* 钱包区域 */
.wallet-section {
background-color: white;
margin: 0rpx 0 20rpx;
padding: 30rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
.section-title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 0 20rpx;
font-size: 32rpx;
font-weight: bold;
color: #333;
border-bottom: 1px solid #eee;
margin-bottom: 20rpx;
}
.wallet-cards {
display: flex;
justify-content: space-between;
}
.wallet-item {
display: flex;
flex-direction: column;
flex: 1;
text-align: center;
color: #333;
}
.label {
font-size: 28rpx;
color: #666;
}
.amount {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 10rpx;
color: #799675;
}
.desc {
font-size: 20rpx;
color: #999;
margin-top: 6rpx;
}
</style>

180
pages/wallet/zhaun.vue Normal file
View File

@@ -0,0 +1,180 @@
<template>
<view style="padding: 30rpx">
<view class="card_zhaun" style="color: #949494">当前余额{{ userInfo.money }}</view>
<view class="card_zhaun">
<view class="card_zhaun_flex">
<view class="card_zhaun_flex_title">划转金额</view>
<input type="number" placeholder="请输入金额" v-model="dataForm.money" />
</view>
<view class="card_zhaun_flex">
<view class="card_zhaun_flex_title">划转给手机号</view>
<input type="number" placeholder="请输入手机号" v-model="dataForm.toPhone" />
</view>
<view class="card_zhaun_flex">
<view class="card_zhaun_flex_title">当前手机号</view>
<input type="number" disabled placeholder="请输入手机号" v-model="userInfo.mobile" />
</view>
<view class="card_zhaun_flex">
<view class="card_zhaun_flex_title">验证码</view>
<view style="display: flex; align-items: center; justify-content: space-between; border-bottom: 1rpx solid #e8e8e8">
<input style="border: 0" type="number" v-model="dataForm.smsCode" placeholder="请输入验证码" />
<view class="code-btn" @click="getCode">{{ current.seconds || codeIngo }}</view>
</view>
</view>
</view>
<view class="card_zhaun">
<view style="color: #f29100">温馨提示</view>
<view style="height: 10rpx"></view>
<view style="font-size: 28rpx; color: #909399">
<view>1.划转金额实时到账不扣手续费</view>
<view style="height: 10rpx"></view>
<view>2.划转成功后实时生效不支持撤回</view>
</view>
</view>
<view class="bottom-btn">
<view class="button-a" @click="confirm">确认</view>
</view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import api from '@/api/index';
import { Store } from '@/store';
import { toast } from '@/utils/fun.js';
import { useCountDown } from '@/uni_modules/wot-design-uni';
let dataForm = ref({
toPhone: '',
smsCode: '',
money: ''
});
const codeIngo = ref('获取验证码');
const { start, pause, reset, current } = useCountDown({
time: 60 * 1000,
onChange(current) {},
onFinish() {
codeIngo.value = '重新发送';
}
});
// 获取验证码方法
const getCode = (e) => {
if (!userInfo.value.mobile) {
toast('请输入手机号');
return;
}
if (current.value.seconds) {
toast('请等待倒计时结束');
return;
}
api.smsCode({
mobile: userInfo.value.mobile,
scene: 6
})
.then((res) => {
start();
toast('验证码发送成功');
})
.catch((err) => {
console.log(err);
toast('验证码发送失败');
});
};
const store = Store();
const userInfo = computed(
() =>
store.userInfo || {
inviteCode: '',
nickname: '',
mobile: '',
avatar: '',
paywallet: {
balance: 0
}
}
);
const confirm = () => {
if (!dataForm.value.toPhone) return uni.showToast({ title: '请输入划转手机号', icon: 'none' });
if (!dataForm.value.money) return uni.showToast({ title: '请输入划转金额', icon: 'none' });
if (!dataForm.value.smsCode) return uni.showToast({ title: '请输入验证码', icon: 'none' });
api.transfer2other(dataForm.value).then((res) => {
uni.showModal({
title: '提示',
content: '划转成功',
showCancel: false,
success: () => {
uni.reLaunch({
url: '/pages/mine/mine'
});
}
});
});
};
</script>
<style lang="scss" scoped>
.card_zhaun {
padding: 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 25rpx;
&_flex {
margin-bottom: 20rpx;
&_title {
font-size: 28rpx;
margin-bottom: 20rpx;
}
input {
font-size: 28rpx;
border-bottom: 1rpx solid #e8e8e8;
padding: 5rpx 0;
}
}
}
.bottom-btn {
width: 100%;
height: 150rpx;
padding: 30rpx;
background-color: #ffffff;
position: fixed;
bottom: 0;
left: 0;
border-radius: 20rpx 20rpx 0 0;
box-shadow: 0px 6rpx 16rpx 2rpx rgba(170, 170, 170, 0.35);
display: flex;
align-items: center;
justify-content: center;
.button-a {
width: 690rpx;
height: 90rpx;
background: #799675;
border-radius: 15rpx;
text-align: center;
font-size: 30rpx;
color: #ffffff;
line-height: 90rpx;
}
}
.code-btn {
width: 175rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
color: #5d7a4e;
border: 1rpx solid #5d7a4e;
text-align: center;
border-radius: 14rpx 14rpx 14rpx 14rpx;
}
</style>

20
static/customicons.css Normal file
View File

@@ -0,0 +1,20 @@
@font-face {
font-family: "customicons"; /* Project id 2878519 */
src:url('/static/customicons.ttf') format('truetype');
}
.customicons {
font-family: "customicons" !important;
}
.youxi:before {
content: "\e60e";
}
.wenjian:before {
content: "\e60f";
}
.zhuanfa:before {
content: "\e610";
}

BIN
static/customicons.ttf Normal file

Binary file not shown.

BIN
static/equity/bei1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
static/equity/bei2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
static/equity/bei3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/equity/icon1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/equity/icon2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/equity/icon3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/equity/iconY1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/equity/iconY2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/equity/iconY3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/equity/img1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/equity/img2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/equity/img3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/equity/s1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
static/equity/s2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
static/equity/s3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
static/equityBei.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
static/equity_pack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
static/homeBanner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
static/homeY.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
static/hui.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/icons/address.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/icons/cancelled.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

BIN
static/icons/cha.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

BIN
static/icons/code.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

BIN
static/icons/finished.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
static/icons/fx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/icons/goodkf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/icons/gou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
static/icons/huazhuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
static/icons/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/icons/kf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/icons/money.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/icons/pre-order.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/icons/tj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/icons/tjr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/icons/wait-pay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

BIN
static/icons/wen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

BIN
static/icons/xia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

BIN
static/icons/yan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

BIN
static/icons/yans.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

BIN
static/icons/youh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

BIN
static/icons/yue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

BIN
static/icons/zhangdan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/login.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/mineBanner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
static/qianBeiAs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
static/qianbaoBei.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
static/settbie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
static/tabbar/cate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
static/tabbar/cates.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/tabbar/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

BIN
static/tabbar/homes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/tabbar/mine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/tabbar/mines.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/tabbar/order.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

BIN
static/tabbar/orders.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/team.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
static/warn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

BIN
static/y.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

BIN
static/yao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

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