This commit is contained in:
2023-10-08 22:53:13 +08:00
parent b883b02fb9
commit e36d60d015
83 changed files with 18303 additions and 9590 deletions

8
.env.development Normal file
View File

@@ -0,0 +1,8 @@
# 开发版appid
TARO_APP_ID='wx7b3322daa2cf9c88'
# API接口
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
# 游戏链接
TARO_APP_GAME='https://game.wanzhuanyongcheng.cn/public/#/pages/index/index?uid='

7
.env.production Normal file
View File

@@ -0,0 +1,7 @@
# 正式版版appid
TARO_APP_ID='wxdd00d46fa6f07974'
# API接口
TARO_APP_API='https://www.wanzhuanyongcheng.cn/app'
TARO_APP_GAME = 'https://www.jdt168.com/public/#/pages/index/index?uid='

8
.env.test Normal file
View File

@@ -0,0 +1,8 @@
# 开发版appid
TARO_APP_ID='wx7b3322daa2cf9c88'
# API接口
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
# 游戏链接
TARO_APP_GAME = 'https://game.wanzhuanyongcheng.cn/public/#/pages/index/index?uid='

8
components.d.ts vendored
View File

@@ -9,7 +9,9 @@ declare module '@vue/runtime-core' {
export interface GlobalComponents {
Auth: typeof import('./src/components/Auth.vue')['default']
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
NutBacktop: typeof import('@nutui/nutui-taro')['Backtop']
NutButton: typeof import('@nutui/nutui-taro')['Button']
NutCalendar: typeof import('@nutui/nutui-taro')['Calendar']
NutCell: typeof import('@nutui/nutui-taro')['Cell']
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
@@ -20,6 +22,7 @@ declare module '@vue/runtime-core' {
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
NutGrid: typeof import('@nutui/nutui-taro')['Grid']
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']
NutInput: typeof import('@nutui/nutui-taro')['Input']
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
@@ -31,11 +34,16 @@ declare module '@vue/runtime-core' {
NutSwipe: typeof import('@nutui/nutui-taro')['Swipe']
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
NutTable: typeof import('@nutui/nutui-taro')['Table']
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
NutTabs: typeof import('@nutui/nutui-taro')['Tabs']
NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
NutUploader: typeof import('@nutui/nutui-taro')['Uploader']
Pay: typeof import('./src/components/Pay.vue')['default']
RichEditor: typeof import('./src/components/RichEditor.vue')['default']
Ucharts: typeof import('./src/components/Ucharts.vue')['default']
Upload: typeof import('./src/components/Upload.vue')['default']
UserModal: typeof import('./src/components/UserModal.vue')['default']
}
}

View File

@@ -64,7 +64,7 @@ const config = {
}
},
cssModules: {
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
enable: true, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'

View File

@@ -10,6 +10,7 @@
},
"scripts": {
"build:weapp": "taro build --type weapp",
"build:test": "taro build --type weapp --mode test",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
@@ -18,7 +19,7 @@
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"dev:weapp": "set NODE_ENV=production && taro build --type weapp --watch",
"dev:weapp": "taro build --type weapp --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
@@ -35,49 +36,50 @@
],
"author": "",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@babel/runtime": "^7.22.15",
"@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.0.4",
"@tarojs/components": "3.6.11",
"@tarojs/helper": "3.6.11",
"@tarojs/plugin-framework-vue3": "3.6.11",
"@tarojs/plugin-html": "3.6.11",
"@tarojs/plugin-platform-alipay": "3.6.11",
"@tarojs/plugin-platform-h5": "3.6.11",
"@tarojs/plugin-platform-jd": "3.6.11",
"@tarojs/plugin-platform-qq": "3.6.11",
"@tarojs/plugin-platform-swan": "3.6.11",
"@tarojs/plugin-platform-tt": "3.6.11",
"@tarojs/plugin-platform-weapp": "3.6.11",
"@tarojs/runtime": "3.6.11",
"@tarojs/shared": "3.6.11",
"@tarojs/taro": "3.6.11",
"@nutui/nutui-taro": "^4.1.5",
"@qiun/vue-ucharts": "2.5.0-20230101",
"@tarojs/components": "3.6.16",
"@tarojs/helper": "3.6.16",
"@tarojs/plugin-framework-vue3": "3.6.16",
"@tarojs/plugin-html": "3.6.16",
"@tarojs/plugin-platform-alipay": "3.6.16",
"@tarojs/plugin-platform-h5": "3.6.16",
"@tarojs/plugin-platform-jd": "3.6.16",
"@tarojs/plugin-platform-qq": "3.6.16",
"@tarojs/plugin-platform-swan": "3.6.16",
"@tarojs/plugin-platform-tt": "3.6.16",
"@tarojs/plugin-platform-weapp": "3.6.16",
"@tarojs/runtime": "3.6.16",
"@tarojs/shared": "3.6.16",
"@tarojs/taro": "3.6.16",
"dayjs": "^1.11.9",
"pinia": "^2.1.6",
"vue": "^3.2.40"
"vue": "^3.3.4"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@tarojs/cli": "3.6.11",
"@tarojs/taro-loader": "3.6.11",
"@tarojs/webpack5-runner": "3.6.11",
"@types/node": "^18.15.11",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"@vue/babel-plugin-jsx": "^1.0.6",
"@vue/compiler-sfc": "^3.2.40",
"babel-preset-taro": "3.6.11",
"@babel/core": "^7.22.17",
"@tarojs/cli": "3.6.16",
"@tarojs/taro-loader": "3.6.16",
"@tarojs/webpack5-runner": "3.6.16",
"@types/node": "^18.17.15",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-sfc": "^3.3.4",
"babel-preset-taro": "3.6.16",
"css-loader": "3.4.2",
"eslint": "^8.12.0",
"eslint-config-taro": "3.6.11",
"eslint": "^8.49.0",
"eslint-config-taro": "3.6.16",
"eslint-plugin-vue": "^9.17.0",
"style-loader": "1.3.0",
"stylelint": "9.3.0",
"ts-node": "^10.9.1",
"typescript": "^4.1.0",
"typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.0.0",
"webpack": "^5.78.0"
"vue-loader": "^17.2.2",
"webpack": "^5.88.2"
}
}

19341
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,6 @@
"miniprogramRoot": "./dist",
"projectname": "taroApp",
"description": "",
"appid": "wxdd00d46fa6f07974",
"setting": {
"urlCheck": true,
"es6": false,

View File

@@ -1,7 +1,40 @@
import request from '../utils/request';
import request from '../utils/request'
// 订单核销
export const orderVerify = (data: object) => request('/user/cancelPointOrder', data, 'POST');
export const orderVerify = (data: object) =>
request('/user/cancelPointOrder', data, 'POST')
// 活动订单核销
export const activeOrderVerify = (data: object) => request('/user/cancelOrder', data, 'POST');
export const activeOrderVerify = (data: object) =>
request('/user/cancelOrder', data, 'POST')
// 获取订单统计
export const orderStatistics = (data: object) =>
request('/store/order/count', data, 'POST')
// 获取商家积分订单列表
export const getJfOrderList = (data: object) =>
request('/store/point/order', data, 'POST')
// 获取商家活动订单列表
export const getActiveOrderList = (data: object) =>
request('/store/order', data, 'POST')
// 获取积分核销列表
export const getJfVerifyList = (data: object) =>
request('/point/order/details', data, 'POST')
// 获取活动核销列表
export const getActiveVerifyList = (data: object) =>
request('/order/details', data, 'POST')
// 增长率统计
export const growthRate = (data: object) =>
request('/store/date/count', data, 'POST')
// 获取提现列表
export const getWithdrawList = (data: object) => request('/store/withdraw', data, 'POST')
// 获取提现列表
export const addWithdraw = (data: object) => request('/store/withdraw/set', data, 'POST')

View File

@@ -1,42 +1,76 @@
import request from '@/utils/request'
import request from "@/utils/request";
// 获取商品列表
export const getGoodsList = () => request('/point/goods', {}, 'POST')
export const getGoodsList = () => request("/point/goods", {}, "POST");
// 添加购物车
export const addCart = (data: object) => request('/user/addCart', data, 'POST')
export const addCart = (data: object) => request("/user/addCart", data, "POST");
// 获取购物车列表
export const getCartList = () => request('/user/cart', {}, 'POST')
export const getCartList = () => request("/user/cart", {}, "POST");
// 获取积分商品详情
export const getGoodsDetail = (data: object) => request('/point/details', data, 'POST')
export const getGoodsDetail = (data: object) =>
request("/point/details", data, "POST");
// 积分商品下单
export const createOrder = (data: object) => request('/point/place', data, 'POST')
export const createOrder = (data: object) =>
request("/point/place", data, "POST");
// 确认付款
export const payJfOrder = (data: object) => request('/point/confirmOrder', data, 'POST')
export const payJfOrder = (data: object) =>
request("/point/confirmOrder", data, "POST");
// 获取活动商品
export const getActiveGoods = () => request('/goods', {}, 'POST')
export const getActiveGoods = () => request("/goods", {}, "POST");
// 获取活动商品详情
export const getActiveGoodsDetail = (data: object) => request('/goods/details', data, 'POST')
export const getActiveGoodsDetail = (data: object) =>
request("/goods/details", data, "POST");
// 活动商品下单
export const createActiveOrder = (data: object) => request('/order/place', data, 'POST')
export const createActiveOrder = (data: object) =>
request("/order/place", data, "POST");
// 活动订单列表
export const getActiveOrderList = (data: object) => request('/user/order', data, 'POST')
export const getActiveOrderList = (data: object) =>
request("/user/order", data, "POST");
// 获取分类列表
export const getCategoryList = () => request('/goods/class', {}, 'POST')
export const getCategoryList = () => request("/goods/class", {}, "POST");
// 活动订单删除
export const deleteActiveOrder = (data: object) => request('/user/order/remove', data, 'POST')
export const deleteActiveOrder = (data: object) =>
request("/user/order/remove", data, "POST");
// 积分订单删除
export const deleteJfOrder = (data: object) => request('/user/point/remove', data, 'POST')
export const deleteJfOrder = (data: object) =>
request("/user/point/remove", data, "POST");
// 获取分类商品
export const getCategoryGoods = (data: object) =>
request("/class/goods/list", data, "POST");
// 获取商家列表
export const getMerList = (data: object) =>
request("/store/list", data, "POST");
// 获取商家商品分类
export const getMerCategory = (data: object) =>
request("/store/classify", data, "POST");
// 获取商家商品
export const getGoodList = (data: object) =>
request("/store/goods", data, "POST");
// // 获取活动商家列表
// export const getHotMerList = (data: object) =>
// request("/store/list", data, "POST");
// // 获取活动商家商品分类
// export const getHotMerCategory = (data: object) =>
// request("/store/classify", data, "POST");
// // 获取活动商家商品
// export const getHotGoodList = (data: object) =>
// request("/store/goods", data, "POST");

View File

@@ -1,8 +1,9 @@
import request from '@/utils/request'
import request from "@/utils/request";
// 订单支付
export const payOrder = (data: object) => request('/order/confirmOrder', data, 'POST')
export const payOrder = (data: object) =>
request("/order/confirmOrder", data, "POST");
// 获取订单统计
export const getOrderStatistics = (data: object) => request('/user/order/count', data, 'POST')
export const getOrderStatistics = (data: object) =>
request("/user/order/count", data, "POST");

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request'
// 商品列表
export const productList = (data: object) =>
request('/store/goods', data, 'POST')
// 商品添加
export const addGood = (data: object) =>
request('/store/goods/edit', data, 'POST')

View File

@@ -2,6 +2,8 @@ import request from "@/utils/request";
// 登录
export const login = (data: object) => request("/login", data, "POST");
export const phoneLogin = (data: object) =>
request("/phone/login", data, "POST");
// 获取用户信息
// export const getUserInfo = () => request("/user/detail", {}, "GET");
@@ -52,4 +54,12 @@ export const getTGUserList = (data: object) =>
request("/user/referee/list", data, "POST");
// 绑定上级
export const bindParent = (data: object) => request("/user/bindCode", data, "POST");
export const bindParent = (data: object) =>
request("/user/bindCode", data, "POST");
// 获取推广码
export const getRefereeCode = () => request("/user/promotion", {}, "POST");
// 取消订单返回积分
export const qxOrder = (data: object) =>
request("/user/point/off", data, "POST");

View File

@@ -18,6 +18,8 @@ export default defineAppConfig({
"distribution/index",
"distribution/integral/index",
"distribution/userlist/index",
"login/index",
"bindPhone/index",
],
},
{
@@ -30,7 +32,19 @@ export default defineAppConfig({
},
{
root: "pages/admin",
pages: ["verify/index"],
pages: [
"verify/index",
"order_manage/index",
"order_manage/list/index",
"order_manage/detail/index",
"verify/verify_list/index",
"statistics/index",
"withdrawal/index",
],
},
{
root: "pages/product",
pages: ["list/index", "addGoods/index"],
},
{
root: "pages/game",
@@ -40,6 +54,10 @@ export default defineAppConfig({
root: "pages/hotGoods",
pages: ["index/index", "hot_list/index"],
},
{
root: "pages/mer",
pages: ["mer_detail/index"],
},
],
window: {
backgroundTextStyle: "light",

View File

@@ -1,22 +1,28 @@
@font-face {
font-family: AlibabaPuHuiTi-3-55-Regular;
src: url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.eot)
format("embedded-opentype"),
url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.otf)
format("opentype"),
url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.ttf)
format("TrueType"),
url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff)
format("woff"),
url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff2)
format("woff2");
}
@import "static/iconfont/iconfont.css";
//@font-face {
// font-family: AlibabaPuHuiTi-3-55-Regular;
// src: url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.eot)
// format("embedded-opentype"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.otf)
// format("opentype"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.ttf)
// format("TrueType"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff)
// format("woff"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff2)
// format("woff2");
//}
page {
font-family: AlibabaPuHuiTi-3-55-Regular, serif;
//font-family: AlibabaPuHuiTi-3-55-Regular, sans-serif;
background-color: #f5f5f5;
}
view {
box-sizing: border-box;
}
.app {
box-sizing: border-box;
background-color: #f5f5f5;
@@ -25,4 +31,4 @@ page {
// 适配ios底部安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
}

View File

@@ -1,10 +1,71 @@
import { createApp } from "vue";
import "./app.scss";
import Taro from "@tarojs/taro";
const scenes = [1007, 1008, 1011, 1012, 1013, 1047, 1048, 1049];
const App = createApp({
onLaunch() {},
onShow() {},
onLaunch(options: {
path: string;
scene: number;
query: object | any;
shareTicket: string;
referrerInfo: object | any;
}) {
// if (scenes.includes(options.scene)) {
// if (options.query.scene) {
// Taro.showToast({
// title: "已检测到推荐人",
// icon: "none",
// });
// Taro.setStorageSync("bind_id", options.query.scene);
// }
// }
// 检测更新
if (Taro.canIUse("getUpdateManager") && options.scene !== 1154) {
const updateManager = Taro.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) {
updateManager.onUpdateFailed(function () {
return Taro.showToast({
title: "新版本下载失败",
icon: "none",
});
});
updateManager.onUpdateReady(function () {
Taro.showModal({
title: "更新提示",
content: "新版本已经下载好,是否重启当前应用?",
success(res) {
if (res.confirm) {
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(function () {
Taro.showModal({
title: "发现新版本",
content: "请删除当前小程序,重启搜索打开...",
});
});
}
});
}
},
onShow() {
const options = Taro.getCurrentInstance().router as any;
console.log("onShow", options);
if (scenes.includes(options.scene)) {
if (options.query.scene) {
Taro.showToast({
title: "已检测到推荐人",
icon: "none",
});
Taro.setStorageSync("bind_id", options.query.scene);
}
}
},
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
});

View File

@@ -1,11 +1,10 @@
<template>
<nut-overlay v-model:visible="visible" :close-on-click-overlay="false">
<nut-overlay :visible="visible" :close-on-click-overlay="false">
<view class="text">
<view>授权提醒</view>
<view style="margin-top: 10px"
>请授权头像信息以便为您提供更好的服务
</view
>
>请授权头像信息以便为您提供更好的服务
</view>
<view class="bom">
<view class="btn b" @click="onCancel">随便逛逛</view>
<view class="btn a" @tap="onOk">去授权</view>
@@ -16,53 +15,63 @@
<script setup lang="ts">
// import { computed, ref } from "vue";
import Taro from '@tarojs/taro'
import {login} from '@/api/user'
import Taro from "@tarojs/taro";
import { login } from "@/api/user";
defineProps({
visible: {
type: Boolean,
default: false
}
})
default: false,
},
});
const emit = defineEmits(['update:visible', 'ok'])
const emit = defineEmits(["update:visible", "ok"]);
const onCancel = () => {
emit('update:visible', false)
}
emit("update:visible", false);
};
const onOk = () => {
Taro.showLoading({
title: "正在授权中",
mask: true,
});
Taro.getUserProfile({
desc: '完善用户资料',
desc: "完善用户资料",
success: async (user) => {
Taro.login({
success: async ({code}) => {
success: async ({ code }) => {
try {
const {data}: any = await login({
const { data }: any = await login({
code: code,
nickName: user.userInfo.nickName,
avatarUrl: user.userInfo.avatarUrl
})
Taro.setStorageSync('token', data.token)
emit('ok', false)
avatarUrl: user.userInfo.avatarUrl,
});
Taro.setStorageSync("token", data.token);
emit("ok", false);
} catch (error) {
Taro.showToast({
title: error.message,
icon: 'none'
})
icon: "none",
});
}
},
fail: (err) => {
console.log(err)
}
})
console.log(err);
},
complete: () => {
Taro.hideLoading();
},
});
},
fail: (err) => {
console.log(err)
}
})
}
console.log(err);
},
complete: () => {
Taro.hideLoading();
},
});
};
</script>
<style lang="scss">

View File

@@ -6,7 +6,7 @@
safe-area-inset-bottom
:close-on-click-overlay="false"
:style="{ height: 'auto' }"
v-model:visible="isShowPay"
:visible="isShowPay"
@click-close-icon="closePay"
>
<view class="div">
@@ -46,66 +46,68 @@
</template>
<script setup lang="ts">
import { ref, watch } from "vue";
import { IconFont } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import { payOrder } from "@/api/order";
import { payJfOrder } from "@/api/goods";
import { getPersonalInfo } from "@/api/user";
import {ref, watch} from 'vue'
import {IconFont} from '@nutui/icons-vue-taro'
import Taro from '@tarojs/taro'
import {payOrder} from '@/api/order'
import {payJfOrder} from '@/api/goods'
import {getPersonalInfo} from '@/api/user'
const prop = defineProps({
isShowPay: {
required: true,
type: Boolean,
default: false,
default: false
},
payType: {
required: true,
type: String,
default: "wx",
default: 'wx'
},
jfInfo: {
type: Object,
default: () => {
return {};
},
},
});
return {}
}
}
})
const emit = defineEmits(["closePay", "successPay"]);
const emit = defineEmits(['closePay', 'successPay'])
const info = ref<any>({});
const info = ref<{ integral?: any }>({})
watch(
() => prop.isShowPay,
() => {
getInfo();
getInfo()
}
);
)
const getInfo = async () => {
try {
const res = await getPersonalInfo();
info.value = res.data.data;
const res = await getPersonalInfo()
info.value = res.data.data
} catch (error) {
Taro.showToast({
title: error.msg,
icon: "none",
});
icon: 'none'
})
throw error
}
};
}
const goPay = async () => {
console.log(prop.jfInfo)
if (!prop.jfInfo)
return Taro.showToast({
title: "未获取到订单信息",
icon: "none",
});
if (prop.payType === "wx") {
title: '未获取到订单信息',
icon: 'none'
})
if (prop.payType === 'wx') {
try {
const { data } = await payOrder({
oid: prop.jfInfo.oid,
});
const {data} = await payOrder({
oid: prop.jfInfo.oid
})
Taro.requestPayment({
timeStamp: data.data.timeStamp,
nonceStr: data.data.nonceStr,
@@ -114,50 +116,51 @@ const goPay = async () => {
paySign: data.data.paySign,
success: function () {
Taro.showToast({
title: "支付成功",
icon: "success",
duration: 2000,
});
title: '支付成功',
icon: 'success',
duration: 2000
})
Taro.navigateTo({
url: "/pages/hotGoods/hot_list/index",
});
url: '/pages/hotGoods/hot_list/index'
})
},
fail: function () {
Taro.showToast({
title: "支付失败",
icon: "none",
duration: 2000,
});
},
});
emit("closePay", false);
title: '支付失败',
icon: 'none',
duration: 2000
})
}
})
emit('closePay', false)
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
icon: 'none'
})
throw e
}
} else {
const res = await payJfOrder(prop.jfInfo);
const res = await payJfOrder(prop.jfInfo)
Taro.showToast({
title: res.msg,
icon: "success",
duration: 2000,
});
icon: 'success',
duration: 2000
})
Taro.navigateTo({
url: "/pages/users/order_list/index",
});
emit("closePay", false);
url: '/pages/users/order_list/index?type=0'
})
emit('closePay', false)
}
};
}
const closePay = () => {
Taro.showToast({
title: "取消支付",
icon: "none",
});
emit("closePay", false);
};
title: '取消支付',
icon: 'none'
})
emit('closePay', false)
}
</script>
<style lang="scss">

View File

@@ -1,381 +1,286 @@
<template>
<view class="container">
<view class="page-body">
<view class="wrapper">
<view
class="toolbar"
@tap="format"
style="max-height: 240px; overflow-y: auto"
>
<!-- 字体 -->
<!-- <view
:class="data.formats.fontFamily ? 'ql-active' : ''"
class="iconfont icon-font"
data-name="fontFamily"
data-value="Pacifico"
></view> -->
<!-- 加粗 -->
<view
:class="data.formats.bold ? 'ql-active' : ''"
class="iconfont icon-zitijiacu"
data-name="bold"
></view>
<!-- 斜体 -->
<view
:class="data.formats.italic ? 'ql-active' : ''"
class="iconfont icon-zitixieti"
data-name="italic"
></view>
<!-- 下划线 -->
<view
:class="data.formats.underline ? 'ql-active' : ''"
class="iconfont icon-zitixiahuaxian"
data-name="underline"
></view>
<!-- 删除中划线 -->
<!-- <view
:class="data.formats.strike ? 'ql-active' : ''"
class="iconfont icon-zitishanchuxian"
data-name="strike"
></view> -->
<!-- 字号 -->
<!-- <view
:class="data.formats.fontSize === '24px' ? 'ql-active' : ''"
class="iconfont icon-font-size"
data-name="fontSize"
data-value="48px"
></view>-->
<!-- 字体颜色 -->
<!-- <view
:class="data.formats.color === '#0000ff' ? 'ql-active' : ''"
class="iconfont icon-font-colors"
data-name="color"
data-value="#0000ff"
></view> -->
<!-- 清除样式 -->
<!-- <view class="iconfont icon-clearformat" @tap="removeFormat"></view> -->
<!-- 对齐方式 -->
<view
:class="data.formats.align === 'left' ? 'ql-active' : ''"
class="iconfont icon-zuoduiqi"
data-name="align"
data-value="left"
></view>
<!-- 对齐方式居中 -->
<view
:class="data.formats.align === 'center' ? 'ql-active' : ''"
class="iconfont icon-juzhongduiqi"
data-name="align"
data-value="center"
></view>
<!-- 对齐方式 -->
<view
:class="data.formats.align === 'right' ? 'ql-active' : ''"
class="iconfont icon-youduiqi"
data-name="align"
data-value="right"
></view>
<!-- 对齐方式两侧 -->
<view
:class="data.formats.align === 'justify' ? 'ql-active' : ''"
class="iconfont icon-zuoyouduiqi"
data-name="align"
data-value="justify"
></view>
<!-- 行高 -->
<!-- <view
:class="data.formats.lineHeight ? 'ql-active' : ''"
class="iconfont icon-line-height"
data-name="lineHeight"
data-value="2"
></view>-->
<!-- 字间距 -->
<!-- <view
:class="data.formats.letterSpacing ? 'ql-active' : ''"
class="iconfont icon-Character-Spacing"
data-name="letterSpacing"
data-value="2em"
></view> -->
<!-- 上边距 -->
<!-- <view
:class="data.formats.marginTop ? 'ql-active' : ''"
class="iconfont icon-duanqianju"
data-name="marginTop"
data-value="40px"
></view> -->
<!-- 下边距 -->
<!-- <view
:class="data.formats.marginBottom ? 'ql-active' : ''"
class="iconfont icon-duanhouju"
data-name="marginBottom"
data-value="40px"
></view> -->
<!-- 日期 -->
<!-- <view class="iconfont icon-date" @tap="insertDate"></view> -->
<!-- 勾选 -->
<!-- <view
class="iconfont icon--checklist"
data-name="list"
data-value="check"
></view> -->
<!-- 有序排列 -->
<view
:class="data.formats.list === 'ordered' ? 'ql-active' : ''"
class="iconfont icon-youxupailie"
data-name="list"
data-value="ordered"
></view>
<!-- 无序排列 -->
<view
:class="data.formats.list === 'bullet' ? 'ql-active' : ''"
class="iconfont icon-wuxupailie"
data-name="list"
data-value="bullet"
></view>
<!-- 取消缩进 -->
<view
class="iconfont icon-outdent"
data-name="indent"
data-value="-1"
></view>
<!-- 缩进 -->
<view
class="iconfont icon-indent"
data-name="indent"
data-value="+1"
></view>
<!-- 添加分割线 -->
<view class="iconfont icon-fengexian" @click="insertDivider"></view>
<!-- 插入图片 -->
<view class="iconfont icon-image" @click="insertImage"></view>
<!-- 设置标题 -->
<view
:class="data.formats.header === 3 ? 'ql-active' : ''"
class="iconfont icon-H"
data-name="header"
:data-value="3"
></view>
<!-- 下标 -->
<view
:class="data.formats.script === 'sub' ? 'ql-active' : ''"
class="iconfont icon-zitixiabiao"
data-name="script"
data-value="sub"
></view>
<!-- 上标 -->
<view
:class="data.formats.script === 'super' ? 'ql-active' : ''"
class="iconfont icon-zitishangbiao"
data-name="script"
data-value="super"
></view>
<!-- 清空 -->
<!-- <view class="iconfont icon-shanchu" @tap="clear"></view> -->
<!-- <view
:class="data.formats.direction === 'rtl' ? 'ql-active' : ''"
class="iconfont icon-direction-rtl"
data-name="direction"
data-value="rtl"
></view> -->
<view class="iconfont icon-undo" @click="undo"></view>
<view class="iconfont icon-redo" @click="redo"></view>
</view>
<view class="editor-wrapper">
<editor
id="editor"
class="ql-container"
:placeholder="data.placeholder"
@statuschange="onStatusChange"
:show-img-resize="true"
@ready="onEditorReady"
@input="getCtx"
:content="content"/>
</view>
</view>
<view class="container">
<view class="page-body">
<view class="wrapper">
<view
class="toolbar"
@click="format"
style="max-height: 240px; overflow-y: auto"
>
<!-- 加粗 -->
<view
:class="data.formats.bold ? 'ql-active' : ''"
class="iconfont icon-zitijiacu"
data-name="bold"
></view>
<!-- 斜体 -->
<view
:class="data.formats.italic ? 'ql-active' : ''"
class="iconfont icon-zitixieti"
data-name="italic"
></view>
<!-- 下划线 -->
<view
:class="data.formats.underline ? 'ql-active' : ''"
class="iconfont icon-zitixiahuaxian"
data-name="underline"
></view>
<!-- 对齐方式 -->
<view
:class="data.formats.align === 'left' ? 'ql-active' : ''"
class="iconfont icon-zuoduiqi"
data-name="align"
data-value="left"
></view>
<!-- 对齐方式居中 -->
<view
:class="data.formats.align === 'center' ? 'ql-active' : ''"
class="iconfont icon-juzhongduiqi"
data-name="align"
data-value="center"
></view>
<!-- 对齐方式 -->
<view
:class="data.formats.align === 'right' ? 'ql-active' : ''"
class="iconfont icon-youduiqi"
data-name="align"
data-value="right"
></view>
<!-- 对齐方式两侧 -->
<view
:class="data.formats.align === 'justify' ? 'ql-active' : ''"
class="iconfont icon-zuoyouduiqi"
data-name="align"
data-value="justify"
></view>
<!-- 有序排列 -->
<view
:class="data.formats.list === 'ordered' ? 'ql-active' : ''"
class="iconfont icon-youxupailie"
data-name="list"
data-value="ordered"
></view>
<!-- 无序排列 -->
<view
:class="data.formats.list === 'bullet' ? 'ql-active' : ''"
class="iconfont icon-wuxupailie"
data-name="list"
data-value="bullet"
></view>
<!-- 取消缩进 -->
<view
class="iconfont icon-outdent"
data-name="indent"
data-value="-1"
></view>
<!-- 缩进 -->
<view
class="iconfont icon-indent"
data-name="indent"
data-value="+1"
></view>
<!-- 添加分割线 -->
<view class="iconfont icon-fengexian" @click="insertDivider"></view>
<!-- 插入图片 -->
<view class="iconfont icon-image" @click="insertImage"></view>
<!-- 设置标题 -->
<view
:class="data.formats.header === 3 ? 'ql-active' : ''"
class="iconfont icon-H"
data-name="header"
:data-value="3"
></view>
<!-- 下标 -->
<view
:class="data.formats.script === 'sub' ? 'ql-active' : ''"
class="iconfont icon-zitixiabiao"
data-name="script"
data-value="sub"
></view>
<!-- 上标 -->
<view
:class="data.formats.script === 'super' ? 'ql-active' : ''"
class="iconfont icon-zitishangbiao"
data-name="script"
data-value="super"
></view>
<view class="iconfont icon-undo" @click="undo"></view>
<view class="iconfont icon-redo" @click="redo"></view>
</view>
<view class="editor-wrapper">
<editor
id="editor"
class="ql-container"
:placeholder="data.placeholder"
@statuschange="onStatusChange"
:show-img-resize="true"
@ready="onEditorReady"
@input="getCtx"
/>
</view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import {reactive} from 'vue'
import Taro from '@tarojs/taro'
import {BASE_URL} from '@/utils/request'
const {content} = defineProps<{
content: string;
content: string;
}>()
let emits = defineEmits(['input'])
const data = reactive<any>({
editorCtx: '',
readOnly: false,
placeholder: '开始输入...',
richText: '',
formats: {}
editorCtx: '',
readOnly: false,
placeholder: '请输入商品详情...',
richText: '',
formats: {}
})
function onEditorReady() {
// 富文本节点渲染完成
Taro
.createSelectorQuery()
.select('#editor')
.context((res) => {
data.editorCtx = res.context
// 初始化数据
if (content) {
data.editorCtx.setContents({
html: content
})
}
})
.exec()
// 富文本节点渲染完成
Taro
.createSelectorQuery()
.select('#editor')
.context((res) => {
data.editorCtx = res.context
// 初始化数据
if (content) {
data.editorCtx.setContents({
html: content
})
}
})
.exec()
}
// 失去焦点时,获取富文本的内容
function getCtx(e: any) {
data.richText = e.detail.html
emits('input', e.detail.html)
function getCtx(e: { detail: { html: any; }; }) {
data.richText = e.detail.html
emits('input', e.detail.html)
}
// 撤销操作
function undo() {
data.editorCtx.undo()
data.editorCtx.undo()
}
// 复原操作
function redo() {
data.editorCtx.redo()
data.editorCtx.redo()
}
//修改样式
function format(e) {
// console.log("format", e.target.dataset);
let {name, value} = e.target.dataset
if (!name) return
data.editorCtx.format(name, value)
function format(e: { target: { dataset: { name: any; value: any; }; }; }) {
// console.log("format", e.target.dataset);
let {name, value} = e.target.dataset
if (!name) return
data.editorCtx.format(name, value)
}
//通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式
function onStatusChange(e) {
data.formats = e.detail
function onStatusChange(e: { detail: any; }) {
data.formats = e.detail
}
// 插入分割线
function insertDivider() {
data.editorCtx.insertDivider()
data.editorCtx.insertDivider()
}
// 插入图片
function insertImage() {
Taro.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
Taro.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
// 上传图片的逻辑各有不同,自行调整即可
Taro.uploadFile({
url: `${BASE_URL}/upload`,
name: 'file',
header: {token: Taro.getStorageSync('token')},
filePath: res.tempFilePaths[0],
success: (res) => {
// 上传图片的逻辑各有不同,自行调整即可
Taro.uploadFile({
url: `/system/v1/upload`,
name: 'file',
header: {Authorization: 'token'},
filePath: res.tempFilePaths[0],
success: (res) => {
const imgData = JSON.parse(res.data) as {
code: number;
msg: string;
success: boolean;
}
if (imgData.code === 200) {
// 将图片展示在编辑器中
data.editorCtx.insertImage({
width: '20%', //设置宽度为100%防止宽度溢出手机屏幕
height: 'auto',
src: imgData.msg,
alt: '图像',
success: function () {
console.log('insert image success')
}
})
} else {
console.log('上传失败')
}
},
fail: (err) => {
console.log(err)
}
console.log(res)
const imgData = JSON.parse(res.data) as {
code: number;
msg: string;
data: any;
}
if (imgData.code === 200) {
// 将图片展示在编辑器中
data.editorCtx.insertImage({
width: '100%',
height: 'auto',
src: imgData.data.data,
alt: '图像',
success: function () {
console.log('insert image success')
}
})
} else {
console.log('上传失败')
}
},
fail: (err) => {
console.log(err)
}
})
})
}
})
}
// 清空编辑器内容
// function clear() {
// data.editorCtx.clear({
// success: function (res) {
// console.log("clear success");
// },
// });
// }
// 清除当前选区的样式
// function removeFormat() {
// data.editorCtx.removeFormat();
// }
// 选择日期
// function insertDate() {
// const date = new Date();
// const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
// data.editorCtx.insertText({
// text: formatDate
// });
// }
</script>
<style lang="scss" scoped>
@import "//at.alicdn.com/t/c/font_4211210_2x20brbrv94.css";
.page-body {
// height: calc(100vh - var(--window-top) - var(--status-bar-height));
}
<style lang="scss">
@import "../static/font_4211210_2x20brbrv94.css";
.wrapper {
height: 100%;
height: 100%;
}
.editor-wrapper {
height: calc(
100vh - var(--window-top) - var(--status-bar-height) - 280px - 650px
);
overflow: scroll;
background: rgba(153, 153, 153, 0.05);
border-radius: 20px;
margin: 20px 0;
height: calc(
100vh - var(--window-top) - var(--status-bar-height) - 280px - 650px
);
overflow: scroll;
background: rgba(153, 153, 153, 0.05);
border-radius: 20px;
margin: 20px 0;
color: #000;
}
.iconfont {
display: inline-block;
margin: 20px 20px;
width: 32px;
height: 32px;
cursor: pointer;
font-size: 32px;
display: inline-block;
margin: 20px 20px;
width: 32px;
height: 32px;
cursor: pointer;
font-size: 32px;
}
.toolbar {
box-sizing: border-box;
border-bottom: 0;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
box-sizing: border-box;
border-bottom: 0;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}
.ql-container {
box-sizing: border-box;
padding: 24px 30px;
width: 100%;
min-height: 30vh;
height: 100%;
font-size: 28px;
line-height: 1.5;
box-sizing: border-box;
padding: 24px 30px;
width: 100%;
min-height: 30vh;
height: 100%;
font-size: 28px;
line-height: 1.5;
}
.ql-active {
color: #f38e48;
color: #f38e48;
}
</style>

178
src/components/Ucharts.vue Normal file
View File

@@ -0,0 +1,178 @@
<template>
<canvas
v-if="canvasId"
:id="canvasId"
:canvasId="canvasId"
:style="{
// width: (cWidth / cWidth) * sysInfo.windowWidth + 'px',
width: cWidth,
height: 250 + 'px',
transform: 'scale(' + 1 / pixelRatio + ')',
marginLeft: (cWidth * (pixelRatio - 1)) / 2 + 'px',
marginTop: (cHeight * (pixelRatio - 1)) / 2 + 'px',
}"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
@error="error"
>
</canvas>
</template>
<script setup lang="ts" name="ucharts">
import uCharts from "../utils/js_sdk/u-charts.min.js";
import Taro from "@tarojs/taro";
const canvases = {};
const props = defineProps({
chartType: {
required: true,
type: String,
default: "column",
},
opts: {
required: true,
type: Object,
default() {
return null;
},
},
canvasId: {
type: String,
default: "u-canvas",
},
cWidth: {
default: 350,
},
cHeight: {
default: 250,
},
pixelRatio: {
type: Number,
default: 1,
},
});
Taro.useLoad(() => {
init();
});
const init = () => {
switch (props.chartType) {
case "column":
initColumnChart();
break;
case "line":
initLineChart();
break;
default:
break;
}
};
const initColumnChart = () => {
const ctx = Taro.createCanvasContext(props.canvasId);
canvases[props.canvasId] = new uCharts({
context: ctx,
type: "column",
fontSize: 11,
background: "#FFFFFF",
pixelRatio: props.pixelRatio,
animation: true,
categories: props.opts.categories,
series: props.opts.series,
enableScroll: true,
width: props.cWidth,
height: props.cHeight,
padding: [15,15,0,5],
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
data: [
{
min: 0,
},
],
},
extra: {
column: {
type: "group",
width: 30,
activeBgColor: "#000000",
activeBgOpacity: 0.08,
},
},
});
};
const initLineChart = () => {
const ctx = Taro.createCanvasContext(props.canvasId);
canvases[props.canvasId] = new uCharts({
context: ctx,
type: "line",
fontSize: 11,
legend: true,
dataLabel: false,
dataPointShape: true,
background: "#FFFFFF",
pixelRatio: props.pixelRatio,
categories: props.opts.categories,
series: props.opts.series,
animation: true,
enableScroll: true,
xAxis: {
// type: "grid",
// gridColor: "#CCCCCC",
// gridType: "dash",
// dashLength: 8,
// itemCount: 4,
scrollShow: true,
disableGrid: true,
},
yAxis: {
gridType: "dash",
gridColor: "#CCCCCC",
dashLength: 8,
splitNumber: 5,
min: 10,
max: 180,
format: (val) => {
return val.toFixed(0) + "元";
},
},
width: props.cWidth * props.pixelRatio,
height: props.cHeight * props.pixelRatio,
extra: {
line: {
type: "straight",
},
},
});
};
const touchStart = (e: any) => {
canvases[props.canvasId].showToolTip(e, {
format: function (item: any, category: any) {
return category + " " + item.name + ":" + item.data;
},
});
canvases[props.canvasId].scrollStart(e);
};
const touchMove = (e: any) => {
canvases[props.canvasId].scroll(e);
};
const touchEnd = (e: any) => {
canvases[props.canvasId].scrollEnd(e);
};
const error = (e: any) => {
throw e;
};
</script>
<style lang="scss"></style>

View File

@@ -1,62 +1,61 @@
<template>
<view>
<nut-uploader
v-model:file-list="fileList"
:url="config.url"
:maximum="max"
:headers="config.headers"
@success="success"
@failure="failure"
:multiple="false"
></nut-uploader>
</view>
<nut-uploader
v-model:file-list="fileList"
:url="config.url"
:maximum="max"
:headers="config.headers"
@success="success"
@failure="failure"
:multiple="false"
>
</nut-uploader>
</template>
<script setup lang="ts">
import { BASE_URL } from "@/utils/request";
import { computed, ref } from "vue";
import Taro from "@tarojs/taro";
import {BASE_URL} from '@/utils/request'
import {computed, ref} from 'vue'
import Taro from '@tarojs/taro'
const props = defineProps({
list: {
type: Array,
default: () => [],
default: () => []
},
max: {
type: Number,
default: 1,
},
});
default: 1
}
})
const emits = defineEmits(["update:list"]);
const emits = defineEmits(['update:list'])
const fileList = computed({
get: () => props.list,
set: (val) => emits("update:list", val),
});
set: (val) => emits('update:list', val)
})
const config = ref({
url: `${BASE_URL}/upload`,
headers: {
token: Taro.getStorageSync("token"),
},
});
token: Taro.getStorageSync('token')
}
})
const success = (res: any) => {
const data = JSON.parse(res.responseText.data);
res.fileItem.url = data.data.data;
const data = JSON.parse(res.responseText.data)
res.fileItem.url = data.data.data
Taro.showToast({
title: "上传成功",
icon: "success",
});
};
title: '上传成功',
icon: 'success'
})
}
const failure = () => {
Taro.showToast({
title: "上传失败",
icon: "error",
});
};
title: '上传失败',
icon: 'error'
})
}
</script>
<style lang="scss"></style>

View File

@@ -1,15 +1,328 @@
<script lang="ts">
import {defineComponent} from 'vue'
<script lang="ts" setup>
import { computed, ref } from "vue";
import Taro from "@tarojs/taro";
import headImg from "../static/def_avatar.png";
import logoImg from "../static/logo.jpg";
import { BASE_URL } from "@/utils/request";
import { getPhone, login } from "@/api/user";
export default defineComponent({
name: "UserModal"
})
const props = defineProps({
isShow: {
type: Boolean,
default: false,
},
});
const emits = defineEmits(["closeEdit", "update:isShow"]);
const userInfo = ref({
nickname: "",
avatar: "",
phone: "",
});
const show = computed({
get: (): boolean => props.isShow,
set: (val) => {
emits("update:isShow", val);
},
});
const mp_is_new = ref(true);
const canvasStatus = ref(false);
const closeAttr = () => {
emits("closeEdit");
};
const onChooseAvatar = (e) => {
const { avatarUrl } = e.detail;
console.log(avatarUrl);
Taro.uploadFile({
url: `${BASE_URL}/upload`,
filePath: avatarUrl,
name: "file",
success: function (res) {
const data = JSON.parse(res.data);
userInfo.value.avatar = data.data.data;
},
});
};
const uploadPic = () => {
canvasStatus.value = true;
};
const getPhoneNumber = async (e: any) => {
Taro.showLoading({
title: "授权手机号中",
mask: true,
});
const { code } = e.detail;
const res = await getPhone({
code: code,
});
userInfo.value.phone = res.data.phone;
Taro.hideLoading();
};
const formSubmit = async (e: any) => {
if (!userInfo.value.avatar)
return Taro.showToast({
title: "请上传头像",
icon: "none",
});
userInfo.value.nickname = e.detail.value.nickname;
if (!userInfo.value.nickname)
return Taro.showToast({
title: "请输入昵称",
icon: "none",
});
if (!userInfo.value.phone)
return Taro.showToast({
title: "请授权手机号码",
icon: "none",
});
const res = await login({
Code: Taro.getStorageSync("wx_code"),
NickName: userInfo.value.nickname,
AvatarUrl: userInfo.value.avatar,
Phone: userInfo.value.phone,
Referee: Taro.getStorageSync("bind_id") || "",
});
emits("closeEdit");
Taro.showToast({
title: res.msg,
icon: "success",
duration: 2000,
});
Taro.setStorageSync("token", res.data.token);
setTimeout(() => {
Taro.removeStorageSync("wx_code");
Taro.removeStorageSync("bind_id");
Taro.switchTab({
url: "/pages/user/index",
});
}, 2000);
};
</script>
<template>
$END$
<view>
<nut-popup
position="bottom"
safe-area-inset-bottom
closeable
:style="{ padding: '20px 10px' }"
v-model:visible="show"
@close="closeAttr"
:close-on-click-overlay="false"
>
<view class="mp-data">
<image class="image" :src="logoImg"></image>
<text class="mp-name">捷兑通 申请</text>
</view>
<view class="trip-msg">
<view class="title"> 获取您的昵称头像 </view>
<view class="trip"> 提供具有辨识度的用户中心界面 </view>
</view>
<form @submit="formSubmit">
<view class="edit">
<view class="avatar edit-box">
<view class="left">
<view class="head">头像</view>
<view
class="avatar-box"
v-if="!mp_is_new"
@click.stop="uploadPic"
>
<image
:src="userInfo.avatar || headImg"
mode="aspectFill"
></image>
</view>
<button
v-else
class="avatar-box"
open-type="chooseAvatar"
@chooseavatar="onChooseAvatar"
>
<image
:src="userInfo.avatar || headImg"
mode="aspectFill"
></image>
</button>
</view>
</view>
<view class="nickname edit-box">
<view class="left">
<view class="head">昵称</view>
<view class="input">
<input
type="nickname"
placeholder-class="pl-sty"
placeholder="请输入昵称"
name="nickname"
:maxlength="16"
:value="userInfo.nickname"
/>
</view>
</view>
</view>
<view class="nickname edit-box">
<view class="left">
<view class="head">号码</view>
<view class="input">
<button
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
>
{{
!userInfo.phone
? "请授权手机号"
: "授权成功"
}}
</button>
</view>
</view>
</view>
</view>
<view class="bottom">
<nut-button
formType="submit"
block
type="success"
color="#07C160"
>
保存
</nut-button>
</view>
</form>
</nut-popup>
</view>
</template>
<style scoped lang="scss">
<style lang="scss">
.mp-data {
display: flex;
align-items: center;
margin-bottom: 30px;
</style>
.mp-name {
font-size: 28px;
font-weight: bold;
color: #000000;
}
.image {
width: 48px;
height: 48px;
border-radius: 50%;
margin-right: 16px;
}
}
.trip-msg {
padding-bottom: 32px;
border-bottom: 1px solid #f5f5f5;
.title {
font-size: 30px;
font-weight: bold;
color: #000;
margin-bottom: 6px;
}
.trip {
font-size: 26px;
color: #777777;
}
}
.edit {
// border-bottom: 1px solid #f5f5f5;
.avatar {
border-bottom: 1px solid #f5f5f5;
}
.nickname {
.input {
width: 100%;
}
border-bottom: 1px solid #f5f5f5;
}
input {
height: 80px;
}
button {
flex: 1;
display: flex;
align-items: center;
background: none;
padding: 0;
height: 50px;
font-size: 28px;
color: #838383;
&::after {
border: none;
}
}
}
.edit-box {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 30px;
padding: 22px 0;
.left {
display: flex;
align-items: center;
flex: 1;
.head {
color: rgba(0, 0, 0, 0.9);
white-space: nowrap;
margin-right: 60px;
}
.avatar-box {
image {
width: 100px;
height: 100%;
border-radius: 6px;
}
}
button {
flex: 1;
display: flex;
align-items: center;
background: none;
height: 100px;
&::after {
border: none;
}
}
}
}
.icon-xiangyou {
color: #cfcfcf;
}
.bottom {
margin-top: 20px;
padding: 0 150px;
.nut-button {
border-radius: 10px;
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '订单详情'
})

View File

@@ -0,0 +1,122 @@
<template>
<view>
<view class="header">
<view>订单号:{{ info.oid }}</view>
<view>{{ info.add_time }}</view>
</view>
<view class="good-info">
<view class="top">
<image :src="info.BindGoods?.cover" />
<view class="title">{{ info.BindGoods?.name }}</view>
</view>
<view class="public-total">
{{ info.count }}件商品已支付
<text class="money">{{ info.number }}</text>
</view>
</view>
<nut-cell-group>
<nut-cell title="订单状态:" :desc="orderStatus"></nut-cell>
<nut-cell
title="下单用户:"
:desc="info.BindUser?.nickName"
></nut-cell>
<nut-cell
title="用户手机号:"
:desc="info.BindUser?.phone"
></nut-cell>
<nut-cell
v-if="info.status === 2"
title="核销人员:"
:desc="info.BindCancelUser?.nickName"
></nut-cell>
<nut-cell
v-if="info.status === 2"
title="核销人手机号:"
:desc="info.BindCancelUser?.phone"
></nut-cell>
</nut-cell-group>
</view>
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { ref, computed } from "vue";
const info = ref<any>({});
Taro.useLoad(() => {
info.value = Taro.getStorageSync("ver_order_info");
});
const orderStatus = computed(() => {
switch (info.value.status) {
case 1:
return "待核销";
case 2:
return "已核销";
case 3:
return "已失效";
}
});
</script>
<style lang="scss">
page {
--nut-cell-desc-color: #000;
}
.header {
background: linear-gradient(90deg, #2291f8 0, #1cd1dc);
padding: 30px;
color: #fff;
font-size: 30px;
}
.user-info {
background-color: #fff;
width: 100%;
}
.good-info {
margin-top: 20px;
width: 100%;
background-color: #fff;
padding: 20px;
.top {
display: flex;
justify-content: space-between;
align-items: flex-start;
image {
width: 200px;
height: 200px;
}
.title {
flex: 1;
padding: 10px;
}
.price {
text-align: right;
}
}
.public-total {
font-size: 28px;
color: #282828;
border-top: 1px solid #eee;
height: 92px;
line-height: 92px;
text-align: right;
padding: 0 30px;
background-color: #fff;
}
.public-total .money {
color: #ff4c3c;
}
}
</style>

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '订单管理'
})

View File

@@ -0,0 +1,237 @@
<template>
<view>
<view class="Card">
<view>全部订单</view>
<view class="orderinfo">
<view class="info" @click="toListPage(0)">
<view class="num">{{ orderInfo?.count?.A || 0 }}</view>
<view class="sub">全部</view>
</view>
<view class="info" @click="toListPage(1)">
<view class="num">{{ orderInfo?.count?.B || 0 }}</view>
<view class="sub">待付款</view>
</view>
<view class="info" @click="toListPage(2)">
<view class="num">{{ orderInfo?.count?.C || 0 }}</view>
<view class="sub">待核销</view>
</view>
<view class="info" @click="toListPage(3)">
<view class="num">{{ orderInfo?.count?.D || 0 }}</view>
<view class="sub">已核销</view>
</view>
<view class="info" @click="toListPage(4)">
<view class="num">{{ orderInfo?.count?.F || 0 }}</view>
<view class="sub">已过期</view>
</view>
</view>
</view>
<view class="Card">
<view class="top"
><text class="iconfont icon-shujutongji icon"></text
><text>数据统计</text></view
>
<view class="gridBox">
<navigator
class="item"
hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=today`"
>
<view class="title">{{
orderInfo?.total?.TodayNumber || 0
}}</view>
<view class="sub">今日成交额</view>
</navigator>
<navigator
class="item"
hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=yesterday`"
>
<view class="title">{{
orderInfo?.total?.YesterdayNumber || 0
}}</view>
<view class="sub">昨日成交额</view>
</navigator>
<navigator
class="item"
hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=month`"
>
<view class="title">{{
orderInfo?.total?.MonthNumber || 0
}}</view>
<view class="sub">本月成交额</view>
</navigator>
<navigator
class="item"
hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=today`"
>
<view class="title">{{
orderInfo?.total?.TodayOrder || 0
}}</view>
<view class="sub">今日订单数</view>
</navigator>
<navigator
class="item"
hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=yesterday`"
>
<view class="title">{{
orderInfo?.total?.YesterdayOrder || 0
}}</view>
<view class="sub">昨日订单数</view>
</navigator>
<navigator
class="item"
hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=month`"
>
<view class="title">{{
orderInfo?.total?.MonthOrder || 0
}}</view>
<view class="sub">本月订单数</view>
</navigator>
</view>
</view>
<view class="Card">
<view class="top"
><text class="iconfont icon-xiangxishuju icon"></text
><text>详细数据</text></view
>
<view v-if="orderInfo?.list?.length > 0">
<nut-table
:bordered="true"
class="table"
:columns="columns"
:data="orderInfo?.list"
></nut-table>
</view>
<nut-empty v-else description="暂无订单数据"></nut-empty>
</view>
</view>
</template>
<script lang="ts" setup>
import { h, ref } from "vue";
import Taro from "@tarojs/taro";
import { orderStatistics } from "../../../api/admin";
Taro.useLoad(() => {
getData();
});
const orderInfo = ref<any>({});
const columns = ref([
{
title: "日期",
key: "Date",
align: "center",
},
{
title: "订单数",
key: "TotalCount",
align: "center",
},
{
title: "交易额",
key: "NumberSum",
align: "center",
render: (row) => {
return h(
"view",
{
style: {
color: "red",
},
},
row.NumberSum
);
},
},
]);
const getData = async () => {
const mer_type = Taro.getStorageSync("mer_type");
const user_info = Taro.getStorageSync("userInfo");
const res = await orderStatistics({
bid: user_info.bid,
type: mer_type,
});
orderInfo.value = res.data;
};
const toListPage = (index: number) => {
Taro.navigateTo({
url: `/pages/admin/order_manage/list/index?type=${index}`,
});
};
</script>
<style lang="scss">
.Card {
width: 90%;
background-color: #fff;
border-radius: 10px;
margin: 10px auto;
padding: 25px;
.top {
display: flex;
align-items: center;
text {
margin-right: 5px;
}
}
}
.icon {
color: red;
}
.gridBox {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(3, 33.33%);
grid-template-rows: repeat(3, 33.33%);
grid-gap: 10px;
justify-content: center;
text-align: center;
.item {
margin-top: 50px;
.title {
font-size: 50px;
}
.sub {
font-size: 25px;
color: #999;
}
}
}
.table {
margin-top: 10px;
}
.orderinfo {
display: flex;
justify-content: space-between;
margin-top: 20px;
align-items: center;
.info {
text-align: center;
.num {
font-size: 40px;
color: red;
}
.sub {
font-size: 25px;
color: #999;
}
}
}
</style>

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '订单列表'
})

View File

@@ -0,0 +1,225 @@
<template>
<view>
<view class="tabs">
<view
class="item"
v-for="item in opt"
:key="item.value"
@click="tabChange(item.value)"
>
<view class="title">{{ item.text }}</view>
<view
class="line"
:style="{
backgroundColor: item.value === tabVal ? 'red' : '',
}"
></view>
</view>
</view>
<view v-if="dataList.length > 0">
<view
class="order-card"
v-for="(item, index) in dataList"
:key="index"
@click="toDetailPage(item)"
>
<view class="top">
<view class="name">订单号:{{ item.oid }}</view>
<!-- <view class="sub">下单时间{{ item.add_time }}</view> -->
<view class="sub"
>核销时间{{ item.cancel_time || "待核销" }}</view
>
<!-- <view style="color: red">{{
item.status === 0
? "待付款"
: item.status === 1
? "待使用"
: item.status === 2
? "已使用"
: "已失效"
}}</view> -->
</view>
<view class="line"></view>
<view class="center">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods.name }} </view>
<view class="right">
<view>{{ item.number }}</view>
<view>x{{ item.count }}</view>
</view>
</view>
<!-- <view
class="bom"
style="text-align: right; font-size: 13px"
>
{{ item.count }}件商品,实付积分:
<text style="color: red">{{ item.number }}</text>
</view> -->
</view>
<view class="line"></view>
</view>
</view>
<nut-empty v-else description="暂无订单数据"></nut-empty>
</view>
</template>
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { getJfOrderList, getActiveOrderList } from "../../../../api/admin";
const opt = ref([
{
text: "全部",
value: 0,
},
{
text: "待付款",
value: 1,
},
{
text: "待核销",
value: 2,
},
{
text: "已核销",
value: 3,
},
{
text: "已失效",
value: 4,
},
]);
const tabVal = ref(0);
const dataList = ref<any>([]);
Taro.useLoad((options) => {
tabVal.value = Number(options.type);
getData();
});
const getData = async () => {
try {
const mer_type = Taro.getStorageSync("mer_type");
const user_info = Taro.getStorageSync("userInfo");
let res: any = null;
const data = {
bid: user_info.bid,
status: tabVal.value,
};
if (mer_type === 1) {
res = await getActiveOrderList(data);
} else {
res = await getJfOrderList(data);
}
dataList.value = res.data.data;
} catch (error) {
Taro.showToast({
title: error.msg,
icon: "none",
});
}
};
const tabChange = (e: number) => {
tabVal.value = e;
getData();
};
const toDetailPage = (item: any) => {
Taro.setStorageSync("ver_order_info", item);
Taro.navigateTo({
url: "/pages/admin/order_manage/detail/index",
});
};
</script>
<style lang="scss">
.tabs {
display: flex;
justify-content: space-evenly;
align-items: center;
background-color: #fff;
padding: 10px;
.item {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
.line {
margin-top: 10px;
width: 50px;
height: 5px;
}
}
}
.order-card {
width: 95%;
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
border-radius: 10px;
padding: 20px;
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.top {
// display: flex;
// justify-content: space-between;
// align-items: center;
.name {
font-weight: bold;
}
.sub {
color: #999;
font-size: 30px;
}
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
.top {
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
}
.title {
margin-left: 10px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
width: 350px;
}
.right {
margin-left: 10px;
font-size: 28px;
text-align: right;
}
}
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "订单数据统计",
});

View File

@@ -0,0 +1,454 @@
<template>
<view class="statistical-page" ref="container">
<view class="navs">
<view class="list">
<view
class="item"
:class="time == 'today' ? 'on' : ''"
@click="setTime('today')"
>
今天
</view>
<view
class="item"
:class="time == 'yesterday' ? 'on' : ''"
@click="setTime('yesterday')"
>
昨天
</view>
<view
class="item"
:class="time == 'seven' ? 'on' : ''"
@click="setTime('seven')"
>
最近7天
</view>
<view
class="item"
:class="time == 'month' ? 'on' : ''"
@click="setTime('month')"
>
本月
</view>
<view
class="item"
:class="time == 'date' ? 'on' : ''"
@click="dateTitle"
>
自定义
</view>
</view>
</view>
<view class="wrapper">
<view class="title">
{{ title }}{{ where.type == 1 ? "营业额" : "订单量" }}
</view>
<view v-if="where.type == 1" class="money">{{
dataObj.all || 0
}}</view>
<view v-else class="money">{{ dataObj.all || 0 }}</view>
<view class="increase">
<view>
{{ time === "date" ? "" : title }}增长率<text
:class="dataObj.growthRate >= 0 ? 'red' : 'green'"
>
{{ dataObj.growthRate }}%
<text
class="iconfont"
:class="
dataObj.growthRate >= 0
? 'icon-xiangshang1'
: 'icon-xiangxia2'
"
></text
></text>
</view>
<view>
{{ time === "date" ? "" : title }}增长<text
:class="dataObj.growthNumber >= 0 ? 'red' : 'green'"
>{{ dataObj.growthNumber }}
<text
class="iconfont"
:class="
dataObj.growthNumber >= 0
? 'icon-xiangshang1'
: 'icon-xiangxia2'
"
></text
></text>
</view>
</view>
</view>
<view class="chart">
<canvas
canvas-id="myChart"
style="width: 100%; height: 250px"
:ontouch="true"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
/>
</view>
<view class="Card">
<view class="top"
><text class="iconfont icon-xiangxishuju icon"></text
><text>详细数据</text></view
>
<view v-if="dataObj?.list?.length > 0">
<nut-table
:bordered="true"
class="table"
:columns="columns"
:data="dataObj?.list"
></nut-table>
</view>
<nut-empty v-else description="暂无订单数据"></nut-empty>
</view>
<!-- 日期选择 -->
<nut-calendar
v-model:visible="isVisible"
type="range"
:start-date="date_start"
@close="isVisible = false"
@choose="setChooseValue"
>
</nut-calendar>
</view>
</template>
<script setup lang="ts">
import { ref, computed, h } from "vue";
import Taro from "@tarojs/taro";
import { growthRate } from "../../../api/admin";
import dayjs from "dayjs";
import uCharts from "../../../utils/js_sdk/u-charts.min.js";
const time = ref("");
const isVisible = ref(false);
let canvas_obj;
const w = Taro.getSystemInfoSync().windowWidth;
const chartWH = ref({
width: w * 0.9,
height: 250,
pixelRatio: 1,
});
const columns = ref([
{
title: "日期",
key: "Date",
align: "center",
},
{
title: "订单数",
key: "TotalCount",
align: "center",
},
{
title: "交易额",
key: "NumberSum",
align: "center",
render: (row) => {
return h(
"view",
{
style: {
color: "red",
},
},
row.NumberSum
);
},
},
]);
const date_start = computed(() => {
return dayjs().startOf("year").format("YYYY-MM-DD");
});
const title = ref("");
const where = ref({
type: 1,
status: 2,
start: "",
end: "",
});
const dataObj = ref<any>({});
const opts = ref<any>({
categories: [],
series: [
{
name: "营业额",
data: [],
},
{
name: "订单量",
data: [],
},
],
});
Taro.useLoad((options) => {
where.value.type = options.type === "price" ? 1 : 2;
time.value = options.time;
setTime(options.time);
// getData();
});
const setTime = (type: string) => {
time.value = type;
switch (type) {
case "today":
title.value = "今日";
where.value.status = 2;
where.value.start = dayjs().format("YYYY-MM-DD");
where.value.end = dayjs().format("YYYY-MM-DD");
break;
case "yesterday":
title.value = "昨日";
where.value.status = 2;
where.value.start = dayjs().add(-1, "day").format("YYYY-MM-DD");
where.value.end = dayjs().add(-1, "day").format("YYYY-MM-DD");
break;
case "seven":
title.value = "7天";
where.value.status = 2;
where.value.start = dayjs().add(-6, "day").format("YYYY-MM-DD");
where.value.end = dayjs().format("YYYY-MM-DD");
break;
case "month":
title.value = "本月";
where.value.status = 1;
where.value.start = dayjs().startOf("month").format("YYYY-MM-DD");
where.value.end = dayjs().format("YYYY-MM-DD");
break;
}
getData();
};
const dateTitle = () => {
where.value.status = 1;
time.value = "date";
isVisible.value = true;
};
const setChooseValue = (ref: any) => {
where.value.start = ref[0][3];
where.value.end = ref[1][3];
title.value = `${where.value.start}-${where.value.end}`;
getData();
};
const getData = async () => {
try {
const mer_type = Taro.getStorageSync("mer_type");
const user_info = Taro.getStorageSync("userInfo");
const res = await growthRate({
bid: user_info.bid,
type: mer_type,
status: where.value.status,
StartTime: where.value.start,
EndTime: where.value.end,
});
dataObj.value = res.data;
opts.value.categories = [];
opts.value.series[0].data = [];
opts.value.series[1].data = [];
res.data.list.forEach((item: any) => {
opts.value.categories.push(item.Date);
opts.value.series[0].data.push(item.NumberSum);
opts.value.series[1].data.push(item.TotalCount);
});
create_canvas();
} catch (error) {
Taro.showToast({
title: error.msg,
icon: "none",
});
throw error;
}
};
const create_canvas = () => {
const ctx = Taro.createCanvasContext("myChart");
canvas_obj = new uCharts({
type: "column",
context: ctx,
width: chartWH.value.width,
height: chartWH.value.height,
categories: opts.value.categories,
series: opts.value.series,
pixelRatio: chartWH.value.pixelRatio,
animation: true,
background: "#FFFFFF",
color: [
"#1890FF",
"#91CB74",
"#FAC858",
"#EE6666",
"#73C0DE",
"#3CA272",
"#FC8452",
"#9A60B4",
"#ea7ccc",
],
padding: [15, 15, 0, 15],
enableScroll: true,
legend: {},
xAxis: {
disableGrid: true,
scrollShow: true,
itemCount: 3,
},
yAxis: {
data: [
{
min: 0,
},
],
},
extra: {
column: {
type: "group",
width: 20,
activeBgColor: "#000000",
activeBgOpacity: 0.08,
},
},
});
};
const touchStart = (e: any) => {
canvas_obj.showToolTip(e, {
format: function (item: any, category: any) {
return category + " " + item.name + ":" + item.data;
},
});
canvas_obj.scrollStart(e);
};
const touchMove = (e: any) => {
canvas_obj.scroll(e);
};
const touchEnd = (e: any) => {
canvas_obj.scrollEnd(e);
};
</script>
<style lang="scss">
.statistical-page {
.navs {
width: 100%;
height: 96px;
background-color: #fff;
overflow: hidden;
line-height: 96px;
position: fixed;
top: 0;
left: 0;
z-index: 9;
.list {
overflow-y: hidden;
overflow-x: auto;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
width: 100%;
.item {
font-size: 32px;
color: #282828;
margin-left: 60px;
display: inline-block;
}
.on {
color: #fa2c19;
}
}
}
.wrapper {
width: 95%;
background-color: #fff;
border-radius: 10px;
margin: 119px auto 0 auto;
padding: 50px 60px;
.title {
font-size: 30px;
color: #999;
text-align: center;
}
.money {
font-size: 72px;
color: #fba02a;
text-align: center;
margin-top: 10px;
}
.increase {
font-size: 28px;
color: #999;
margin-top: 20px;
display: flex;
justify-content: space-between;
align-items: center;
.red {
color: #ff6969;
}
.green {
color: #1abb1d;
}
.iconfont {
font-size: 23px;
margin-left: 15px;
}
}
}
.chart {
width: 95%;
box-sizing: border-box;
background-color: #fff;
border-radius: 10px;
margin: 23px auto;
padding: 10px;
}
.Card {
width: 95%;
background-color: #fff;
border-radius: 10px;
margin: 10px auto;
padding: 25px;
.top {
display: flex;
align-items: center;
text {
margin-right: 5px;
}
.iconfont {
color: #fa2c19;
}
}
.table {
margin-top: 10px;
}
}
}
</style>

View File

@@ -10,7 +10,6 @@
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { orderVerify, activeOrderVerify } from "@/api/admin";
// url参数转对象
// const urlParse = (url: string) => {
@@ -35,20 +34,8 @@ const scanCode = () => {
success: async (res) => {
try {
const mer_type = JSON.parse(Taro.getStorageSync("mer_type"));
let data;
if (mer_type === 1) {
data = await activeOrderVerify({
oid: res.result,
});
} else {
data = await orderVerify({
oid: res.result,
});
}
Taro.showToast({
title: data.msg,
icon: "none",
Taro.navigateTo({
url: `/pages/admin/verify/verify_list/index?oid=${res.result}&mer_type=${mer_type}`,
});
} catch (error) {
Taro.showToast({

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "核销列表",
});

View File

@@ -0,0 +1,146 @@
<template>
<view>
<view class="card">
<view>订单号{{ goodInfo.oid }}</view>
<view class="line"></view>
<view class="container">
<image
class="image"
:src="goodInfo.cover"
mode="widthFix"
></image>
<view class="info">
<view class="title">{{ goodInfo.goods_name }}</view>
<view class="num"
>数量:
<text style="color: red">{{
goodInfo.count
}}</text></view
>
</view>
<view></view>
</view>
<view class="line"></view>
<view class="cz">
<nut-button size="small" type="primary" @click="subVerify"
>确定核销</nut-button
>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import {
getJfVerifyList,
getActiveVerifyList,
activeOrderVerify,
orderVerify,
} from "@/api/admin";
import { ref } from "vue";
const opt = ref<any>({});
Taro.useLoad((options) => {
opt.value = options;
getData(options);
});
const goodInfo = ref<any>({});
const getData = async (options: any) => {
let res;
if (Number(options.mer_type) === 1) {
res = await getActiveVerifyList({
oid: options.oid,
});
} else {
res = await getJfVerifyList({
oid: options.oid,
});
}
if (!res.data.data.oid) {
Taro.showToast({
title: "没有此订单",
icon: "none",
});
setTimeout(() => {
Taro.navigateBack({
delta: 1,
});
}, 3000);
}
goodInfo.value = res.data.data;
};
const subVerify = async () => {
try {
let res;
if (Number(opt.value.mer_type) === 1) {
res = await activeOrderVerify({
oid: goodInfo.value.oid,
});
} else {
res = await orderVerify({
oid: goodInfo.value.oid,
});
}
Taro.showToast({
title: res.msg,
icon: "none",
});
setTimeout(() => {
Taro.navigateBack({
delta: 1,
});
}, 3000);
} catch (error) {
Taro.showToast({
title: error.msg,
icon: "none",
});
throw error;
}
};
</script>
<style lang="scss">
.card {
padding: 20rpx;
background-color: #fff;
margin: 10px auto;
width: 90%;
border-radius: 7px;
.container {
display: flex;
image {
width: 200px;
height: 100%;
border-radius: 7px;
display: block;
}
.info {
margin-left: 20px;
}
.title {
margin-bottom: 10px;
}
}
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px 0;
}
.cz {
text-align: right;
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "收益提现",
});

View File

@@ -1,15 +1,197 @@
<script lang="ts">
import {defineComponent} from 'vue'
<script lang="ts" setup>
import {ref, h} from 'vue'
import Taro from '@tarojs/taro'
import {getWithdrawList, addWithdraw} from '@/api/admin'
export default defineComponent({
name: "index"
const user_info = Taro.getStorageSync('userInfo')
const row = ref(0)
const basicData = ref({
num: ''
})
const showPreview = ref(false)
const imgData = ref([{
src: ''
}])
const columns = ref([
{
title: '时间',
key: 'add_time',
align: 'center'
}, {
title: '提现金额',
key: 'integral',
align: 'center',
render: (row: { integral: number; }) => {
return h('view', {}, row.integral / 100)
}
},
{
title: '审核状态',
key: 'status',
align: 'center',
render: (row: { status: number; }) => {
return h('view', {
class: `tag ${row.status === 1 ? 'success' : row.status === 2 ? 'danger' : 'warning'}`
}, {
default: () => row.status === 1 ? '已打款' : row.status === 2 ? '已拒绝' : '待审核'
})
}
},
{
title: '备注',
key: 'img',
align: 'center',
render: (row: { status_img: string; }) => {
return h('img', {
class: 'image',
onClick: () => {
imgData.value[0].src = row.status_img
showPreview.value = true
},
src: row.status_img
})
}
}
])
const data = ref([])
const pagination = ref({
page: 1,
itemsPerPage: 5,
showPageSize: 5,
totalItems: 0,
change: (page: number) => {
pagination.value.page = page
getData()
}
})
const hideFn = () => {
showPreview.value = false
}
Taro.useLoad(() => {
getData()
})
const getData = async () => {
try {
const res = await getWithdrawList({
PageNum: pagination.value.page,
PageSize: pagination.value.showPageSize,
Bid: user_info.bid
})
data.value = res.data.data || []
pagination.value.totalItems = res.data.total
row.value = res.data.integral || 0
console.log(res)
} catch (e) {
throw e
}
}
const add = async () => {
try {
if (Number(basicData.value.num) === 0) return Taro.showToast({
title: '提现积分需大于0',
icon: 'none'
})
const res = await addWithdraw({
Bid: user_info.bid,
Number: Number(basicData.value.num)
})
Taro.showToast({
title: res.msg,
icon: 'none'
})
await getData()
} catch (e) {
throw e
}
}
</script>
<template>
$END$
<view>
<nut-form>
<nut-form-item label="提现积分:">
<nut-input v-model="basicData.num" class="nut-input-text" placeholder="请输入提现积分" type="text"/>
</nut-form-item>
<nut-form-item>
<view>
当前可提现积分
<text class="text-red">{{ row }}</text>
</view>
<view style="margin-top: 10px">
实际到账
<text class="text-red">{{ (row / 100).toFixed(2) }}</text>
</view>
</nut-form-item>
<nut-form-item>
<nut-button block type="primary" @click="add">立即提现</nut-button>
</nut-form-item>
</nut-form>
<view v-if="data.length > 0">
<view class="data">
<nut-table :columns="columns" :data="data"></nut-table>
<nut-pagination class="pagination" v-model="pagination.page" :total-items="pagination.totalItems"
:items-per-page="pagination.itemsPerPage" :show-page-size="pagination.showPageSize"
@change="pagination.change" :bordered="false"/>
</view>
</view>
<nut-empty v-else description="暂无提现记录"></nut-empty>
<!-- 图片预览 -->
<nut-image-preview :show="showPreview" :images="imgData" @close="hideFn"/>
</view>
</template>
<style scoped lang="scss">
<style lang="scss">
.text-red {
color: red;
}
.data {
display: flex;
flex-direction: column;
justify-content: center;
background-color: #fff;
padding: 10px;
.pagination {
margin: 10px auto;
}
}
.tag {
width: 100%;
padding: 5px 8px;
color: white;
border-radius: 8px;
margin: 0 auto;
}
.success {
background-color: #4fc08d;
}
.danger {
background-color: #df3526;
}
.warning {
background-color: #f3812e;
}
.image {
width: 50px;
height: 50px;
}
</style>

View File

@@ -3,21 +3,58 @@
style="height: 100vh"
v-model="val"
title-scroll
name="tab4value"
ellipsis
:animated-time="10"
name="tabs"
direction="vertical"
@change="tabChange"
>
<nut-tab-pane v-for="item in list" :title="(item.name as string)">
Tab {{ item.name }}</nut-tab-pane
<nut-tab-pane
v-for="item in list"
:title="(item.name as string)"
:key="item.ID"
>
<view v-if="goodList.length > 0">
<view
class="list"
v-for="(item, index) in (goodList as any)"
:key="index"
>
<view class="item">
<img :src="item.cover" />
<view class="right">
<view class="name">{{ item.name }}</view>
<view class="bom">
<view class="price"
><text style="font-size: 15px">{{
item.number
}}</text>
积分</view
>
<nut-button
size="mini"
type="primary"
@click.stop="
toGoodDetails(item.gid as number)
"
>去兑换</nut-button
>
</view>
</view>
</view>
</view>
</view>
<nut-empty v-else description="暂无商品"></nut-empty>
</nut-tab-pane>
</nut-tabs>
</template>
<script lang="ts" setup>
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getCategoryList } from "@/api/goods";
import { getCategoryList, getCategoryGoods } from "@/api/goods";
const val = ref("0");
const val = ref(0);
interface List {
ID?: number;
@@ -26,18 +63,82 @@ interface List {
const list = ref<Array<List>>([]);
Taro.useLoad(() => {
getGoodsType();
console.log("load");
});
const goodList = ref([]);
Taro.useDidShow(() => {});
Taro.useDidShow(() => {
getGoodsType();
});
// 获取商品分类
const getGoodsType = async () => {
const res = await getCategoryList();
list.value = res.data.data;
getData(list.value[val.value].ID as number);
};
const getData = async (id: number) => {
const res = await getCategoryGoods({
class_id: id,
});
goodList.value = res.data.data;
};
const tabChange = async () => {
getData(list.value[val.value].ID as number);
};
const toGoodDetails = (gid: number) => {
Taro.navigateTo({
url: `/pages/goods/goods_detail/index?gid=${gid}`,
});
};
</script>
<style lang="scss"></style>
<style lang="scss">
.list {
.item {
display: flex;
margin-bottom: 10px;
img {
width: 140px;
height: 140px;
border-radius: 10px;
}
.right {
flex: 1;
margin-left: 5px;
display: flex;
flex-direction: column;
justify-content: center;
// text-align: right;
.name {
// height: 20px;
font-size: 28px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
}
.bom {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-top: 10px;
.price {
font-size: 20px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
</style>

View File

@@ -6,59 +6,14 @@
<script setup lang="ts">
import { ref } from "vue";
import { useLoad } from "@tarojs/taro";
// const listVal = ref<any>([]);
import { useLoad, getStorageSync } from "@tarojs/taro";
const url = ref("");
useLoad((options) => {
console.log(options);
// getList();
url.value = `https://www.jdt168.com/public/#/pages/index/index?uid=${options.uid}`;
console.log(url.value);
useLoad(() => {
const user = getStorageSync("userInfo");
url.value = `${process.env.TARO_APP_GAME}${user.uid}`;
});
// const getList = () => {
// for (let i = 0; i < 1; i++) {
// setTimeout(() => {
// listVal.value.push({
// id: i,
// status: true,
// });
// }, 50 * i);
// }
// };
// const toDetails = (id: string) => {
// navigateTo({
// url: "/pages/game/gamedetail/index?id=" + id,
// });
// };
</script>
<style lang="scss">
.list-box {
background-color: #fff;
border-radius: 15rpx;
width: 630rpx;
height: 200rpx;
margin: 20rpx auto;
padding: 30rpx;
font-size: 45rpx;
}
.listBoxAnim {
animation: 0.5s leftAnim;
}
@keyframes leftAnim {
from {
transform: translateX(110%);
}
to {
transform: translateX(0);
}
}
</style>
<style lang="scss"></style>

View File

@@ -12,9 +12,10 @@ import { WebView } from "@tarojs/components";
const gameUrl = ref("");
const user = getStorageSync("userInfo");
const user = ref({})
useLoad(() => {
user.value = getStorageSync("userInfo");
console.log(user);
});
</script>

View File

@@ -27,8 +27,8 @@
:symbol="payType === 'jf' ? '积分' : '元'"
/>
</view>
<view class="title">{{ goodInfo.name }} </view>
<view class="sub">{{ goodInfo.profile }} </view>
<view class="title">{{ goodInfo.name }}</view>
<view class="sub">{{ goodInfo.profile }}</view>
</view>
<nut-cell title="请选择规格: " is-link @click="openSku"></nut-cell>
<!-- 产品介绍 -->
@@ -40,7 +40,6 @@
:nodes="goodInfo.details"
></rich-text>
<nut-empty v-else description="暂无产品介绍"></nut-empty>
</view>
<view style="height: 9vh"></view>
<!-- 底部 -->
@@ -50,33 +49,30 @@
<Home />
<view>首页</view>
</view>
<view
class="icon"
v-if="payType === 'jf'"
@click="toPage('/pages/cart/index')"
>
<Cart />
<view>购物车</view>
</view>
<!-- <view-->
<!-- class="icon"-->
<!-- v-if="payType === 'jf'"-->
<!-- @click="toPage('/pages/cart/index')"-->
<!-- >-->
<!-- <Cart/>-->
<!-- <view>购物车</view>-->
<!-- </view>-->
<view class="icon" @click="toPage('/pages/kefu/index', 2)">
<My />
<view>客服</view>
</view>
</view>
<!-- 占位 -->
<view>
<nut-button
v-if="payType === 'jf'"
style="margin-right: 10px"
type="warning"
@click="add_cart()"
>加入购物车
</nut-button>
<nut-button
:style="payType === 'wx' ? 'width: 200px' : ''"
type="primary"
@click="toOrderDetail()"
<view style="width: 80%">
<!-- <nut-button-->
<!-- v-if="payType === 'jf'"-->
<!-- style="margin-right: 10px"-->
<!-- type="warning"-->
<!-- @click="add_cart()"-->
<!-- >加入购物车-->
<!-- </nut-button>-->
<nut-button type="primary" block @click="toOrderDetail()"
>{{ payType === "jf" ? "立即兑换" : "立即购买" }}
</nut-button>
</view>
@@ -99,6 +95,7 @@
<nut-input-number
v-model="count"
@change="addCount"
button-size="30"
/>
</template>
</nut-cell>
@@ -126,11 +123,16 @@
var statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { Left, Home, Cart, My } from "@nutui/icons-vue-taro";
import {
Left,
Home,
// Cart,
My,
} from "@nutui/icons-vue-taro";
import {
getGoodsDetail,
getActiveGoodsDetail,
addCart,
// addCart,
createOrder,
createActiveOrder,
} from "@/api/goods";
@@ -178,11 +180,12 @@ const get_good_detail = async (gid: string) => {
} else {
res = await getActiveGoodsDetail({ gid: gid });
}
goodInfo.value = res.data.data;
goodInfo.value = {
...res.data.data,
// details: res.data.data.details.,
};
swiperList.value = res.data.data.rotation.split(",");
console.log(goodInfo.value);
} catch (e) {
Taro.showToast({
title: e.msg,
@@ -221,25 +224,40 @@ const openSku = () => {
// const selectSku = () => {};
// const clickBtnOperate = () => {};
// const close = () => {};
const add_cart = async () => {
if (isSkuShow.value === false) return openSku();
try {
await addCart({ gid: goodInfo.value.gid });
Taro.showToast({
title: "加入购物车成功",
icon: "success",
duration: 2000,
});
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
isSkuShow.value = false;
};
// const add_cart = async () => {
// if (isSkuShow.value === false) return openSku();
// try {
// await addCart({ gid: goodInfo.value.gid });
// Taro.showToast({
// title: "加入购物车成功",
// icon: "success",
// duration: 2000,
// });
// } catch (e) {
// Taro.showToast({
// title: e.msg,
// icon: "none",
// });
// }
// isSkuShow.value = false;
// };
const toOrderDetail = async () => {
if (!Taro.getStorageSync("token")) {
return Taro.showModal({
title: "提示",
content: "你还没登录,请先登录",
cancelText: "先逛逛",
confirmText: "去登录",
success: (res) => {
if (res.confirm) {
Taro.reLaunch({
url: "/pages/users/login/index",
});
}
},
});
}
if (isSkuShow.value === false) return openSku();
// Taro.navigateTo({
// url: '/pages/goods/order_create/index'
@@ -260,7 +278,7 @@ const toOrderDetail = async () => {
});
}
orderData.value = res.data.data;
orderData.value = res?.data?.data;
isShowPay.value = true;
@@ -298,6 +316,12 @@ const toPage = (url: string, type: number = 1) => {
</script>
<style lang="scss">
page {
--nut-cell-box-shadow: none;
// --nut-cell-padding: 0;
--nut-cell-title-font: 30px;
}
// sku遮罩
.overlay {
background-color: rgba(0, 0, 0, 0.5);
@@ -311,12 +335,7 @@ const toPage = (url: string, type: number = 1) => {
position: fixed;
left: 30px;
top: 0;
/* #ifdef MP */
// height: 43px;
/* #endif */
/* #ifdef H5 */
height: 114px;
/* #endif */
}
.head-menu {
@@ -337,7 +356,7 @@ const toPage = (url: string, type: number = 1) => {
.nut-swiper-item img {
width: 100%;
height: 550px;
height: 730px;
}
.card {
@@ -371,13 +390,12 @@ const toPage = (url: string, type: number = 1) => {
}
.rich {
box-sizing: border-box;
// &[img] {
// max-width: 100%;
// }
width: 100%;
// &[alt] {
// max-width: 100%;
// img {
// width: 100%;
// height: auto;
// display: block;
// }
}
}
@@ -395,8 +413,9 @@ const toPage = (url: string, type: number = 1) => {
.bottom-box {
border-top: 1px solid #e5e5e585;
position: fixed;
box-sizing: border-box;
bottom: 0;
height: 5.5vh;
height: 150rpx;
background: #fff;
display: flex;
justify-content: space-between;
@@ -405,7 +424,7 @@ const toPage = (url: string, type: number = 1) => {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
z-index: 999;
width: 100vw;
width: 100%;
.left {
display: flex;

View File

@@ -46,6 +46,7 @@ const tabsList = ref([
const jfInfo = ref({});
interface OrderList {
oid: string;
add_time: string;
status: number;
BindGoods: {
@@ -222,7 +223,7 @@ const delOrder = async (oid: string) => {
<view class="title">{{ item.BindGoods.name }} </view>
<view class="right">
<view>{{ item.number }}</view>
<view>x{{ item.count }}</view>
<!-- <view>x{{ item.count }}</view> -->
</view>
</view>
<!-- <view

View File

@@ -20,7 +20,7 @@
</view>
</view>
<!-- 商品列表 -->
<view class="goodBox">
<!-- <view class="goodBox">
<view
class="good"
v-for="item in list"
@@ -41,37 +41,97 @@
</view>
</view>
</view>
</view> -->
<view class="goodBox">
<view
class="good"
v-for="item in (merdata as any)"
:key="item.ID"
@click.stop="toMerDetails(item)"
>
<image :src="(item.head_photo as string)" />
<view class="good-text-box">
<text class="good-text">{{ item.name }}</text>
<text style="color: #999"
>距离我{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(item.lat),
Number(item.lon)
)
}}</text
>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { useLoad, navigateTo } from "@tarojs/taro";
import { getActiveGoods } from "../../../api/goods";
import Taro from "@tarojs/taro";
import {
// getActiveGoods,
getMerList,
} from "../../../api/goods";
import { IconFont } from "@nutui/icons-vue-taro";
import { calculateDistance } from "@/utils";
const list = ref<any>([]);
// const list = ref<any>([]);
useLoad(() => {
getList();
Taro.useLoad(() => {
// getList();
get_mer_list();
});
const getList = async () => {
const res = await getActiveGoods();
console.log(res);
list.value = res.data.data;
};
// const getList = async () => {
// const res = await getActiveGoods();
// console.log(res);
// list.value = res.data.data;
// };
const toGoodDetails = (id: number) => {
navigateTo({
url: `/pages/goods/goods_detail/index?gid=${id}&type=1`,
// const toGoodDetails = (id: number) => {
// Taro.navigateTo({
// url: `/pages/goods/goods_detail/index?gid=${id}&type=1`,
// });
// };
const hotGoodsDetail = () => {
Taro.navigateTo({
url: `/pages/hotGoods/hot_list/index`,
});
};
const hotGoodsDetail = () => {
navigateTo({
url: `/pages/hotGoods/hot_list/index`,
const merdata = ref([]);
const userLocalNum = ref({
l: 0,
t: 0,
});
const get_mer_list = async () => {
Taro.getLocation({
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
const res = await getMerList({
PageNum: 1,
PageSize: 10,
Btype: 1,
classid: 0,
});
merdata.value = res.data.data;
};
const toMerDetails = (item: any) => {
Taro.setStorageSync("mer_info", item);
Taro.navigateTo({
url: `/pages/mer/mer_detail/index`,
});
};
</script>

View File

@@ -1,3 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '首页',
navigationBarTitleText: '首页',
enableShareAppMessage: true
})

View File

@@ -30,9 +30,9 @@
</nut-grid>
</view>
<!-- 标题 -->
<view class="titleImg">为你推荐</view>
<!-- <view class="titleImg">为你推荐</view> -->
<!-- 商品列表 -->
<view class="goodBox">
<!-- <view class="goodBox">
<view
class="good"
v-for="item in list"
@@ -41,23 +41,68 @@
>
<image :src="(item.cover as string)" />
<view class="good-text-box">
<text class="good-text">{{ item.name }} </text>
<text class="good-text">{{ item.name }}</text>
<view class="good-price-box">
<text class="good-text-price">
<text style="font-size: 20px">{{
item.number
}}</text>
<text style="font-size: 20px"
>{{ item.number }}
</text>
积分
</text>
<!-- <Cart
<Cart
size="20"
color="#ff0000"
@click.stop="add_cart(item.gid as number)"
/> -->
/>
</view>
</view>
</view>
</view> -->
<view class="goodBox">
<view
class="good"
v-for="item in (merdata as any)"
:key="item.ID"
@click.stop="toMerDetails(item)"
>
<image :src="(item.head_photo as string)" />
<view class="good-text-box">
<text class="good-text">{{ item.name }}</text>
<text style="color: #999"
>距离我{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(item.lat),
Number(item.lon)
)
}}</text
>
</view>
</view>
</view>
<!-- 商家列表 -->
<!-- <view class="merBox">
<view class="item" v-for="item in merdata" :key="item.ID">
<view class="left">
<image
class="img"
src="//www.wanzhuanyongcheng.cn/static/bdae68d9512fecacf744eea61f92e71.jpg"
></image>
</view>
<view class="right">
<view class="title">{{ item.name }}</view>
<view class="tag">
<view class="left">
<text>喷射</text>
<text>汉堡</text>
<text>炸鸡</text>
</view>
<view class="right">距我900m</view>
</view>
</view>
</view>
</view> -->
</view>
</template>
@@ -65,8 +110,12 @@
import { ref } from "vue";
// import { Cart } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import { getBanner } from "@/api/user";
import { getGoodsList, addCart } from "@/api/goods";
import { getBanner, bindParent } from "@/api/user";
import {
// getGoodsList,
getMerList,
} from "@/api/goods";
import { calculateDistance } from "@/utils";
const searchValue = ref("");
// const tabvalue = ref("0");
@@ -100,23 +149,71 @@ const userMenuList = ref([
},
]);
interface List {
gid?: number;
name?: string;
number?: number;
cover?: string;
}
// interface List {
// gid?: number;
// name?: string;
// number?: number;
// cover?: string;
// }
const list = ref<Array<List>>([]);
// const list = ref<Array<List>>([]);
Taro.useLoad(() => {
Taro.useDidShow(async () => {
getBannerList();
get_goods_list();
// get_goods_list();
get_mer_list();
if (Taro.getStorageSync("token") && Taro.getStorageSync("bind_id")) {
try {
const res = await bindParent({
uid: Taro.getStorageSync("bind_id"),
});
Taro.showToast({
title: res.msg,
});
Taro.removeStorageSync("bind_id");
} catch (error) {
Taro.removeStorageSync("bind_id");
throw error;
}
}
});
const get_goods_list = async () => {
const { data } = await getGoodsList();
list.value = data.data;
Taro.useShareAppMessage(() => ({
title: "捷兑通",
path: `/pages/index/index?scene=${Taro.getStorageSync("token")}`,
imageUrl:
"https://upload.jdt168.com/1694242954957988438_微信图片_20230909150016.jpg",
}));
// const get_goods_list = async () => {
// const { data } = await getGoodsList();
// list.value = data.data;
// };
const merdata = ref([]);
const userLocalNum = ref({
l: 0,
t: 0,
});
const get_mer_list = async () => {
Taro.getLocation({
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
const res = await getMerList({
PageNum: 1,
PageSize: 10,
Btype: 2,
classid: 0,
});
merdata.value = res.data.data;
console.log(res);
};
const getBannerList = async () => {
@@ -146,19 +243,21 @@ const toPage = (url: string) => {
});
};
const toGoodDetails = (gid: number) => {
// const toGoodDetails = (gid: number) => {
// Taro.navigateTo({
// url: `/pages/goods/goods_detail/index?gid=${gid}`,
// });
// };
const toMerDetails = (item: any) => {
Taro.setStorageSync("mer_info", item);
Taro.navigateTo({
url: `/pages/goods/goods_detail/index?gid=${gid}`,
url: `/pages/mer/mer_detail/index`,
});
};
</script>
<style lang="scss">
.app {
box-sizing: border-box;
background-color: #f5f5f5;
}
.nut-swiper-item img {
width: 100%;
height: 350px;
@@ -198,12 +297,13 @@ const toGoodDetails = (gid: number) => {
width: 340px;
background-color: #fff;
margin-bottom: 20px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
border-radius: 10px;
image {
width: 100%;
height: 350px;
height: 250px;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
}
.good-text-box {
@@ -216,7 +316,7 @@ const toGoodDetails = (gid: number) => {
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
-webkit-line-clamp: 1;
overflow: hidden;
word-break: break-word;
}
@@ -239,4 +339,60 @@ const toGoodDetails = (gid: number) => {
}
}
}
.merBox {
padding: 10px;
.item {
display: flex;
// align-items: center;
background-color: #fff;
border-radius: 20px;
padding: 20px;
margin-bottom: 10px;
.left {
.img {
width: 150px;
height: 150px;
border-radius: 10px;
}
}
.right {
flex: 1;
margin-left: 15px;
border-bottom: 2px solid #f5f5f5;
.title {
width: 100%;
font-weight: bold;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
word-break: break-word;
}
.tag {
margin: 10px 0;
color: #999;
width: 100%;
display: flex;
justify-content: space-evenly;
.left {
display: flex;
width: 50%;
text {
margin-right: 10px;
}
}
.right {
flex: 1;
text-align: right;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "",
});

View File

@@ -0,0 +1,308 @@
<template>
<view>
<!-- 幻灯片 -->
<nut-swiper
:init-page="0"
:pagination-visible="true"
pagination-color="red"
auto-play="3000"
>
<nut-swiper-item
v-for="(itm, idx) in (swiperList as any)"
:key="idx"
>
<img
style="width: 100%; height: 100%"
:src="itm"
:alt="idx.toString()"
/>
</nut-swiper-item>
</nut-swiper>
<!-- 商家信息 -->
<view class="infoBox">
<view class="title">{{ mer_info.name }}</view>
<view class="bom">
<view class="left">
<view>{{ mer_info.address || "暂无商家地址" }}</view>
<view class="sub"
>距你{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(mer_info.lat),
Number(mer_info.lon)
)
}}</view
>
</view>
<view class="right">
<view @click="clickMap">
<Locationg3 color="red" size="25" />
<view>导航</view>
</view>
<view @click="clickPhone">
<Find color="red" size="25" />
<view>电话</view>
</view>
</view>
</view>
</view>
<!-- 商品列表 -->
<!-- <view class="good">
<view class="item"></view>
</view> -->
<view class="good-class" v-if="class_list.length > 0">
<nut-tabs
v-model="value"
title-scroll
direction="vertical"
title-gutter="5"
animated-time="0"
name="tabName"
@click="clickTab"
>
<nut-tab-pane
v-for="(item, index) in class_list"
:title="item.name"
:pane-key="index"
>
<view v-if="good_list.length > 0">
<view
class="list"
v-for="(item, index) in (good_list as any)"
:key="index"
>
<view class="item">
<img :src="item.cover" />
<view class="right">
<view class="name">{{ item.name }}</view>
<view class="bom">
<view class="price"
><text style="font-size: 15px">{{
item.number
}}</text>
{{
mer_info.bType === 1
? "元"
: "积分"
}}</view
>
<nut-button
size="mini"
v-if="mer_info.bType === 1"
type="primary"
@click.stop="
toGoodDetails(
item.gid as number,
1
)
"
>去购买</nut-button
>
<nut-button
size="mini"
v-else
type="primary"
@click.stop="
toGoodDetails(
item.gid as number,
2
)
"
>去兑换</nut-button
>
</view>
</view>
</view>
</view></view
>
<nut-empty v-else description="该分类暂无商品"></nut-empty>
</nut-tab-pane>
</nut-tabs>
</view>
<nut-empty v-else description="该商家暂无商品"></nut-empty>
</view>
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { Find, Locationg3 } from "@nutui/icons-vue-taro";
import { ref } from "vue";
import { calculateDistance } from "../../../utils";
import { getMerCategory, getGoodList } from "../../../api/goods";
const swiperList = ref([]);
const mer_info = ref<any>({});
const value = ref("0");
const userLocalNum = ref({
l: 0,
t: 0,
});
Taro.useLoad(() => {
Taro.getLocation({
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
mer_info.value = Taro.getStorageSync("mer_info");
Taro.setNavigationBarTitle({
title: mer_info.value.name,
});
swiperList.value = mer_info.value.img.split(",");
get_class_list();
});
const clickPhone = () => {
Taro.makePhoneCall({
phoneNumber: mer_info.value.phone,
});
};
const clickMap = () => {
Taro.openLocation({
name: mer_info.value.name,
address: mer_info.value.address,
latitude: Number(mer_info.value.lat),
longitude: Number(mer_info.value.lon),
scale: 18,
});
};
const class_list = ref<
Array<{
ID?: number;
name?: string;
}>
>([]);
const get_class_list = async () => {
const res = await getMerCategory({
Bid: mer_info.value.bid,
});
class_list.value = res.data.data || [];
get_good_list(class_list.value[0].ID as number);
};
const clickTab = (val: any) => {
get_good_list(class_list.value[val.paneKey].ID as number);
};
const good_list = ref([]);
const get_good_list = async (id: number) => {
Taro.showLoading({
title: "加载中",
mask: true,
});
const res = await getGoodList({
bid: mer_info.value.bid,
BType: mer_info.value.bType,
class_id: id,
status: 1,
state: 1,
});
good_list.value = res.data.data || [];
Taro.hideLoading();
};
const toGoodDetails = (id: number, type: number) => {
Taro.navigateTo({
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}`,
});
};
</script>
<style lang="scss">
.nut-swiper {
height: 350px;
}
.infoBox {
background-color: #fff;
padding: 20px;
.title {
font-size: large;
font-weight: bold;
}
.bom {
display: flex;
align-items: flex-end;
margin-top: 10px;
.left {
width: 80%;
.sub {
color: #999;
}
}
.right {
flex: 1;
display: flex;
justify-content: space-between;
color: #999;
text-align: center;
}
}
}
.good-class {
margin-top: 10px;
.nut-tabs {
height: 100vh;
border-top: #fff 10px solid;
}
}
.list {
.item {
display: flex;
margin-bottom: 10px;
img {
width: 140px;
height: 140px;
border-radius: 10px;
}
.right {
flex: 1;
margin-left: 5px;
display: flex;
flex-direction: column;
justify-content: center;
// text-align: right;
.name {
// height: 20px;
font-size: 28px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
}
.bom {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-top: 10px;
.price {
font-size: 20px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '商品添加/编辑'
})

View File

@@ -1,15 +1,158 @@
<script lang="ts">
import {defineComponent} from 'vue'
<script lang="ts" setup>
import Taro from '@tarojs/taro'
import {Ref, ref} from 'vue'
import Upload from '../../../components/Upload.vue'
import RichEditor from '../../../components/RichEditor.vue'
import {addGood} from '@/api/product'
export default defineComponent({
name: "index"
const ruleForm = ref(null) as Ref
const basicData = ref({
name: '',
class_id: null,
cover: [],
rotation: [],
profile: '',
details: '',
stock: null,
number: null,
market_num: null,
state: 2
})
const rules = {
name: [{
required: true,
message: '请填写商品名称'
}],
class_id: [{
required: true,
message: '请选择商品分类'
}],
cover: [{
required: true,
message: '请上传商品封面',
validator: (value) => {
return value.length > 0
}
}],
rotation: [{
required: true,
message: '请上传商品轮播图',
validator: (value) => {
return value.length > 0
}
}],
profile: [{
required: true,
message: '请填写商品名称'
}],
stock: [{
required: true,
message: '请填写商品库存'
}],
number: [{
required: true,
message: '请填写商品价格'
}],
market_num: [{
required: true,
message: '请填写商品市场价'
}]
}
const columnsClass = ref([])
Taro.useLoad((options) => {
console.log(options)
})
const openGoodClass = ref(false)
const confirmClass = (val: any) => {
console.log(val)
}
const ok = async () => {
ruleForm.value.validate().then(({valid, errors}: any) => {
if (valid) {
console.log('success', basicData.value)
} else {
console.log('error submit!!', errors)
}
})
}
</script>
<template>
$END$
<view>
{{ basicData }}
<nut-backtop>
<template v-slot:content>
<nut-form ref="ruleForm" :model-value="basicData" :rules="rules">
<nut-form-item label="商品分类:" required prop="class_id">
<nut-input v-model="basicData.class_id" disabled placeholder="请选择商品分类"
@click="openGoodClass = true"/>
</nut-form-item>
<nut-form-item label="商品封面:" required prop="cover">
<Upload v-model:list="basicData.cover"/>
</nut-form-item>
<nut-form-item label="商品轮播图:" required prop="rotation">
<Upload v-model:list="basicData.rotation" :max="10"/>
</nut-form-item>
<nut-form-item label="商品名称:" required prop="name">
<nut-input v-model="basicData.name" placeholder="请输入商品名称"
type="text"
/>
</nut-form-item>
<nut-form-item label="商品价格:" required prop="number">
<nut-input v-model="basicData.number" placeholder="请输入商品价格"
/>
</nut-form-item>
<nut-form-item label="市场价格:" required prop="market_num">
<nut-input v-model="basicData.market_num" placeholder="请输入市场价格"
/>
</nut-form-item>
<nut-form-item label="商品库存:" required prop="stock">
<nut-input v-model="basicData.stock" placeholder="请输入商品库存"
/>
</nut-form-item>
<nut-form-item label="商品简介:" required prop="profile">
<nut-textarea
class="textarea"
v-model="basicData.profile" placeholder="请输入商品简介"
type="text"/>
</nut-form-item>
<nut-form-item label="上架状态:" prop="state">
<nut-switch v-model="basicData.state" :active-value="1" :inactive-value="2"/>
</nut-form-item>
<nut-form-item prop="details">
<RichEditor :content="basicData.details" @input="(val) => basicData.details = val"/>
</nut-form-item>
<nut-form-item prop="ok">
<nut-button block type="primary" @click="ok">提交</nut-button>
</nut-form-item>
</nut-form>
</template>
</nut-backtop>
<!-- 商品分类 -->
<nut-popup position="bottom" v-model:visible="openGoodClass" @close="openGoodClass = false">
<nut-picker :columns="columnsClass" title="商品分类" @confirm="confirmClass"
></nut-picker>
</nut-popup>
</view>
</template>
<style scoped lang="scss">
<style lang="scss">
.nut-input {
border: none;
color: #000;
}
.textarea {
height: 100px;
background-color: #FAFAFA;
padding: 10px !important;
border-radius: 10px;
}
</style>

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,418 +1,477 @@
<template>
<view class="app">
<view class="app">
<view
class="user-center-card__header__transparent"
v-if="isLogin"
:style="{ width: isLogin ? '100%' : '70%' }"
>
<view class="user-center-card__header__avatar">
<nut-avatar size="large">
<img :src="userInfo.avatarUrl"/>
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view
class="user-center-card__header__transparent"
v-if="isLogin"
:style="{ width: isLogin ? '100%' : '70%' }"
class="user-center-card__header__info__name"
@click="toPage('/pages/users/user_setting/index')"
>{{ userInfo.nickName }}
</view
>
<view class="user-center-card__header__avatar">
<nut-avatar size="large">
<img :src="userInfo.avatarUrl" />
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view class="user-center-card__header__info__name">{{
userInfo.nickName
}}</view>
<view v-if="!userInfo.phone">
<nut-button
size="mini"
open-type="getPhoneNumber"
@getphonenumber="getphonenumber"
>点击绑定手机号
</nut-button>
</view>
</view>
<view class="rightIcon">
<Scan style="margin-right: 20px" @click="scanCode" size="22" />
<Setting
style="margin-right: 20px"
@click="toSetting"
size="22"
/>
</view>
<view v-if="!userInfo.phone">
<nut-button
size="mini"
open-type="getPhoneNumber"
@getphonenumber="getphonenumber"
>点击绑定手机号
</nut-button>
</view>
<view v-else class="user-center-card__header__transparent">
<view class="user-center-card__header__avatar">
<nut-avatar size="large">
<img
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view
class="user-center-card__header__info__name"
@tap="clickLogin"
>点击立即授权
</view>
</view>
</view>
<view class="container">
<!--我的订单-->
<view class="cell-card">
<view class="top">
<view>我的订单</view>
<view class="sub" @click="toOrderList(0)">
<view>全部订单</view>
<ArrowRight />
</view>
</view>
<view class="center">
<view class="center-t" @click="toOrderList(1)">
<!-- <Order size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
size="40"
/>
<view class="center-text">待付款</view>
</view>
<view class="center-t" @click="toOrderList(2)">
<!-- <Clock size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/002434c9ed4774cb732517eb27e0ff547a41c606.png"
size="40"
/>
<view class="center-text">待使用</view>
</view>
<view class="center-t" @click="toOrderList(3)">
<!-- <Shop size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/7c2ca0228180fe5f3b1d74b0043d80e76c42eb7d.png"
size="40"
/>
<view class="center-text">已使用</view>
</view>
<view class="center-t" @click="toOrderList(4)">
<!-- <Del size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/c4f4e069dddfa7104f794a46a759a7ed478b81ea.png"
size="40"
/>
<view class="center-text">已失效</view>
</view>
</view>
</view>
<!-- 我的服务 -->
<view class="user-center">
<view>我的服务</view>
<view class="box">
<view
class="box-mini"
v-if="isLogin"
v-for="item in userMenuList"
:key="item.id"
@click="toPage(item.url)"
>
<!-- <image :src="item.icon" /> -->
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
</view>
</view>
<!-- 商家管理 -->
<view class="mer-box" v-if="userInfo.bid">
<nut-grid :gutter="10" :border="false">
<nut-grid-item
:border="false"
text="订单核销"
@click="toPage('/pages/admin/verify/index')"
>
<IconFont
size="50"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></IconFont>
</nut-grid-item>
<!-- <nut-grid-item text="订单统计">
<IconFont
size="50"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></IconFont>
</nut-grid-item> -->
</nut-grid>
</view>
<!-- 版权 -->
<!--<view class="copy">© 2023 </view>-->
</view>
<!-- 登录 -->
<Auth
:visible="isShowLogin"
@update:visible="cancelLogin"
@ok="getUserInfo"
</view>
<view class="rightIcon">
<Scan style="margin-right: 20px" @click="scanCode" size="22"/>
<Setting
style="margin-right: 20px"
@click="toSetting"
size="22"
/>
</view>
</view>
<view v-else class="user-center-card__header__transparent">
<view class="user-center-card__header__avatar">
<nut-avatar size="large">
<img
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view
class="user-center-card__header__info__name"
@click="clickLogin"
>点击立即登录
</view>
</view>
</view>
<view class="container">
<!--我的订单-->
<view class="cell-card">
<view class="top">
<view>我的订单</view>
<view class="sub" @click="toOrderList(0)">
<view>全部订单</view>
<ArrowRight/>
</view>
</view>
<view class="center">
<view class="center-t" @click="toOrderList(1)">
<!-- <Order size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
size="40"
/>
<view class="center-text">待付款</view>
</view>
<view class="center-t" @click="toOrderList(2)">
<!-- <Clock size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/002434c9ed4774cb732517eb27e0ff547a41c606.png"
size="40"
/>
<view class="center-text">待使用</view>
</view>
<view class="center-t" @click="toOrderList(3)">
<!-- <Shop size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/7c2ca0228180fe5f3b1d74b0043d80e76c42eb7d.png"
size="40"
/>
<view class="center-text">已使用</view>
</view>
<view class="center-t" @click="toOrderList(4)">
<!-- <Del size="25px"/> -->
<IconFont
name="http://article.biliimg.com/bfs/article/c4f4e069dddfa7104f794a46a759a7ed478b81ea.png"
size="40"
/>
<view class="center-text">已失效</view>
</view>
</view>
</view>
<!-- 我的服务 -->
<view class="user-center">
<view>我的服务</view>
<view class="box">
<view
class="box-mini"
v-if="isLogin"
v-for="item in userMenuList"
:key="item.id"
@click="toPage(item.url)"
>
<!-- <image :src="item.icon" /> -->
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
<button v-if="isLogin" class="box-mini" open-type='contact'>
<IconFont size="40"
name="http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png"></IconFont>
<text class="label">联系客服</text>
</button>
</view>
</view>
<!-- 商家管理 -->
<view class="mer-box" v-if="userInfo.bid">
<nut-grid :gutter="10" :border="false">
<nut-grid-item
:border="false"
text="订单核销"
@click="toPage('/pages/admin/verify/index')"
>
<IconFont
size="50"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></IconFont>
</nut-grid-item>
<nut-grid-item
text="订单统计"
@click="toPage('/pages/admin/order_manage/index')"
>
<IconFont
size="50"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></IconFont>
</nut-grid-item>
<nut-grid-item
text="收益提现"
@click="toPage('/pages/admin/withdrawal/index')"
>
<IconFont
size="50"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></IconFont>
</nut-grid-item>
<!-- <nut-grid-item-->
<!-- text="商品管理"-->
<!-- @click="toPage('/pages/product/list/index')"-->
<!-- >-->
<!-- <IconFont-->
<!-- size="50"-->
<!-- name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"-->
<!-- ></IconFont>-->
<!-- </nut-grid-item>-->
</nut-grid>
</view>
<!-- 版权 -->
<!-- <view class="copy">© 2023 </view>-->
</view>
<!-- 登录 -->
<Auth
:visible="isShowLogin"
@update:visible="cancelLogin"
@ok="getUserInfo"
/>
</view>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { ArrowRight, Setting, IconFont, Scan } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import Auth from "@/components/Auth.vue";
import { getPersonalInfo, getPhone, bindParent } from "@/api/user";
import {ref} from 'vue'
import {ArrowRight, Setting, IconFont, Scan} from '@nutui/icons-vue-taro'
import Taro from '@tarojs/taro'
import Auth from '@/components/Auth.vue'
import {getPersonalInfo, getPhone, bindParent} from '@/api/user'
const isShowLogin = ref(false);
const isShowLogin = ref(false)
const isLogin = ref(false);
const isLogin = ref(false)
interface UserInfo {
nickName?: string;
avatarUrl?: string;
ID?: string;
bid?: string;
phone?: string;
uid?: string;
nickName?: string;
avatarUrl?: string;
ID?: string;
bid?: string;
phone?: string;
uid?: string;
}
const userInfo = ref<UserInfo>({});
const userInfo = ref<UserInfo>({})
Taro.useDidShow(() => {
const token = Taro.getStorageSync("token");
if (token) {
getUserInfo();
}
});
const token = Taro.getStorageSync('token')
if (token) {
getUserInfo()
}
})
const cancelLogin = () => {
isShowLogin.value = false;
};
isShowLogin.value = false
}
const getUserInfo = async () => {
Taro.showLoading({
title: "加载中",
});
const res = await getPersonalInfo();
userInfo.value = res.data.data;
Taro.setStorageSync("userInfo", res.data.data);
Taro.setStorageSync("mer_type", res.data.store_type);
isLogin.value = true;
cancelLogin();
Taro.hideLoading();
};
Taro.showLoading({
title: '加载中'
})
const res = await getPersonalInfo()
userInfo.value = res.data.data
Taro.setStorageSync('userInfo', res.data.data)
Taro.setStorageSync('mer_type', res.data.store_type)
isLogin.value = true
cancelLogin()
Taro.hideLoading()
}
const getphonenumber = async (e: any) => {
await getPhone({
uid: userInfo.value.uid,
code: e.detail.code,
});
getUserInfo();
};
await getPhone({
uid: userInfo.value.uid,
code: e.detail.code
})
await getUserInfo()
}
const toOrderList = (e: number) => {
if (!isLogin)
return Taro.showToast({
title: "请先登录",
icon: "none",
});
Taro.navigateTo({
url: `/pages/users/order_list/index?type=${e}`,
});
};
if (!isLogin)
return Taro.showToast({
title: '请先登录',
icon: 'none'
})
Taro.navigateTo({
url: `/pages/users/order_list/index?type=${e}`
})
}
const userMenuList = ref([
{
id: 1,
label: "我的账户",
url: "/pages/users/account/index",
icon: "http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png",
},
// {
// id: 2,
// label: "商家入驻",
// url: "/pages/users/account/index",
// icon: "http://jdt168.com/uploads/default/20220829/583fd6cbd729b24eab9c3cae20ae694d.png",
// },
{
id: 3,
label: "我的推广",
url: "/pages/users/distribution/index",
icon: "http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png",
},
{
id: 4,
label: "关注商家",
url: "",
icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
},
{
id: 5,
label: "问题反馈",
url: "",
icon: "http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png",
},
]);
{
id: 1,
label: '我的账户',
url: '/pages/users/account/index',
icon: 'http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png'
},
// {
// id: 2,
// label: "商家入驻",
// url: "/pages/users/account/index",
// icon: "http://jdt168.com/uploads/default/20220829/583fd6cbd729b24eab9c3cae20ae694d.png",
// },
{
id: 3,
label: '我的推广',
url: '/pages/users/distribution/index',
icon: 'http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png'
},
{
id: 4,
label: '关注商家',
url: '',
icon: 'http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png'
}
// {
// id: 5,
// label: '联系客服',
// url: '',
// icon: 'http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png'
// }
])
const toSetting = () => {
Taro.navigateTo({
url: "/pages/users/setting/index",
});
};
Taro.navigateTo({
url: '/pages/users/setting/index'
})
}
const clickLogin = () => {
isShowLogin.value = true;
};
// isShowLogin.value = true
Taro.redirectTo({
url: '/pages/users/login/index'
})
}
const toPage = (url: string) => {
Taro.navigateTo({
url: url,
});
};
Taro.navigateTo({
url: url
})
}
const scanCode = () => {
Taro.scanCode({
onlyFromCamera: true,
scanType: ["qrCode"],
success: async (data) => {
try {
await bindParent({
uid: data.result,
});
Taro.showToast({
title: "绑定成功",
icon: "none",
});
} catch (error) {
Taro.showToast({
title: error.msg,
icon: "none",
});
}
},
});
};
Taro.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: async (data) => {
try {
await bindParent({
uid: data.result
})
Taro.showToast({
title: '绑定成功',
icon: 'none'
})
} catch (error) {
Taro.showToast({
title: error.msg,
icon: 'none'
})
}
}
})
}
</script>
<style lang="scss">
.app {
box-sizing: border-box;
background-color: #f5f5f5;
height: 100vh;
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
background-size: auto 40%;
background-repeat: no-repeat;
position: relative;
color: var(--nut-grid-item-text-color, var(--nut-title-color2, #666666));
box-sizing: border-box;
background-color: #f5f5f5;
height: 100vh;
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
background-size: auto 40%;
background-repeat: no-repeat;
position: relative;
color: var(--nut-grid-item-text-color, var(--nut-title-color2, #666666));
}
.user-center-card__header__avatar {
img {
border-radius: 50%;
}
img {
border-radius: 50%;
}
}
.user-center-card__header__transparent {
position: absolute;
left: 30px;
top: 200px;
background-color: transparent;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
text-align: left;
position: absolute;
left: 30px;
top: 200px;
background-color: transparent;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
text-align: left;
.user-center-card__header__info {
margin-left: 20px;
width: 400px;
color: #333;
font-weight: bolder;
}
.user-center-card__header__info {
margin-left: 20px;
width: 400px;
color: #333;
font-weight: bolder;
}
.rightIcon {
height: 100px;
margin: auto;
}
.rightIcon {
height: 100px;
margin: auto;
}
}
.container {
position: absolute;
top: 350px;
width: 710px;
position: absolute;
top: 350px;
width: 710px;
}
.cell-card {
box-sizing: border-box;
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
width: 710px;
box-sizing: border-box;
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
width: 710px;
.top {
display: flex;
justify-content: space-between;
align-items: center;
.top {
display: flex;
justify-content: space-between;
align-items: center;
.sub {
display: flex;
color: #c9c9c9;
align-items: center;
}
.sub {
display: flex;
color: #c9c9c9;
align-items: center;
}
}
.center {
display: flex;
justify-content: space-between;
color: #666;
padding: 0 30px;
.center {
display: flex;
justify-content: space-between;
color: #666;
padding: 0 30px;
.center-t {
margin-top: 30px;
display: flex;
flex-direction: column;
align-items: center;
.center-t {
margin-top: 30px;
display: flex;
flex-direction: column;
align-items: center;
.center-text {
margin-top: 15px;
}
}
.center-text {
margin-top: 15px;
}
}
}
}
.user-center {
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
width: 710px;
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
width: 710px;
box-sizing: border-box;
.box {
margin-top: 20px;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
.box {
margin-top: 20px;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
.box-mini {
display: flex;
box-sizing: border-box;
flex-direction: column;
align-items: center;
width: 150px;
margin-bottom: 20px;
margin-right: 13px;
.box-mini {
display: flex;
box-sizing: border-box;
flex-direction: column;
align-items: center;
width: 150px;
margin-bottom: 20px;
margin-right: 13px;
.label {
font-size: 25px;
margin-top: 10px;
color: #333;
}
.label {
font-size: 25px;
margin-top: 10px;
color: #333;
}
image {
width: 80px;
height: 80px;
}
}
image {
width: 80px;
height: 80px;
}
}
button {
width: 150px;
position: relative;
margin-left: auto;
margin-right: auto;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
// font-size: 18px;
text-align: center;
text-decoration: none;
// line-height: 1;
line-height: 1.35;
// border-radius: 5px;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
color: #000000;
background-color: #fff;
height: 100%;
}
button::after {
border: none;
background: transparent;
}
}
}
.mer-box {
box-sizing: border-box;
background-color: #fff;
border-radius: 20px;
margin: 20px;
width: 710px;
box-sizing: border-box;
background-color: #fff;
border-radius: 20px;
margin: 20px;
width: 710px;
}
</style>

View File

@@ -3,22 +3,28 @@ import { ref } from "vue";
import { showToast, useLoad, getStorageSync } from "@tarojs/taro";
import { getIntegralDetail, getBeanDetail } from "@/api/user";
const tabValue = ref(0);
const tabValue = ref(1);
const tabsList = ref([
{
title: "积分明细",
value: 0,
title: "兑换明细",
value: 1,
},
{
title: "赠送明细",
value: 3,
},
{
title: "豆子明细",
value: 1,
value: 2,
},
]);
const tabChange = (index: number) => {
tabValue.value = index;
data.value = [];
getList();
page.value.PageNum = 1;
};
const data = ref([]);
@@ -44,16 +50,16 @@ const pageChange = (e: number) => {
const getList = async () => {
try {
let res: any;
if (tabValue.value === 0) {
res = await getBeanDetail({
PageNum: page.value.PageNum,
PageSize: page.value.PageSize,
});
const newData = {
PageNum: page.value.PageNum,
PageSize: page.value.PageSize,
Type: tabValue.value,
};
if (tabValue.value === 1 || tabValue.value === 3) {
res = await getBeanDetail(newData);
} else {
res = await getIntegralDetail({
PageNum: page.value.PageNum,
PageSize: page.value.PageSize,
});
delete data.Type;
res = await getIntegralDetail(newData);
}
data.value = res.data.data || [];
page.value.ItemCount = res.data.count;
@@ -96,20 +102,24 @@ const getList = async () => {
</view>
</view>
<view v-if="data.length > 0">
<view v-if="tabValue === 0">
<view v-if="tabValue === 1 || tabValue === 3">
<view
class="card-list"
v-for="(item, index) in (data as any[])"
:key="index"
>
<view class="left">
<view>购买商品{{ item.goods_name }}</view>
<view>支付时间{{ item.add_time.slice(0, 10) }}</view>
<view>商品{{ item.goods_name }}</view>
<view>时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view style="color: green"
<view v-if="tabValue === 1" style="color: green"
>-<text>{{ item.number }}积分</text></view
>
<view v-if="tabValue === 3" style="color: red"
>+<text>{{ item.number }}</text
>积分</view
>
</view>
</view>
</view>
@@ -120,9 +130,9 @@ const getList = async () => {
:key="index"
>
<view class="left">
<view>购买商品{{ item.goods_name }}</view>
<view>支付金额{{ item.order_number }}</view>
<view>支付时间{{ item.add_time.slice(0, 10) }}</view>
<view class="text">商品{{ item.goods_name }}</view>
<view>金额{{ item.order_number }}</view>
<view>时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view style="color: red"
@@ -228,5 +238,25 @@ const getList = async () => {
padding: 20px;
justify-content: space-between;
align-items: center;
.left {
width: 500px;
.text {
text-align: left;
width: 100%;
// 超出一行隐藏
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
word-break: break-word;
}
}
.right {
flex: 1;
text-align: right;
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '手机号登录'
})

View File

@@ -1,15 +1,166 @@
<script lang="ts">
import {defineComponent} from 'vue'
<script lang="ts" setup>
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getVerifyCode, phoneLogin } from "@/api/user";
import logoImg from "../../../static/logo.jpg";
export default defineComponent({
name: "index"
})
Taro.useLoad((options) => {
console.log(options);
});
const basicData = ref({
phone: "",
code: "",
});
const smsDisabled = ref(false);
const smsStr = ref("获取验证码");
// 获取验证码
const getSmsCode = async () => {
if (
!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(
basicData.value.phone
)
)
return Taro.showToast({
title: "请输入正确的手机号码",
icon: "none",
});
await getVerifyCode({
phone: basicData.value.phone.toString(),
});
smsDisabled.value = true;
let time = 60;
const timer = setInterval(() => {
time--;
smsStr.value = `${time}s`;
if (time === 0) {
clearInterval(timer);
smsDisabled.value = false;
smsStr.value = "获取验证码";
}
}, 1000);
};
const login = async () => {
if (
!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(
basicData.value.phone
)
)
return Taro.showToast({
title: "请输入正确的手机号码",
icon: "none",
});
if (!basicData.value.code)
return Taro.showToast({
title: "请输入验证码",
icon: "none",
});
const res = await phoneLogin({
Phone: basicData.value.phone,
Code: basicData.value.code,
Referee: Taro.getStorageSync("bind_id") || "",
});
Taro.showToast({
title: res.msg,
icon: "success",
duration: 2000,
});
Taro.setStorageSync("token", res.data.token);
setTimeout(() => {
Taro.removeStorageSync("bind_id");
Taro.switchTab({
url: "/pages/user/index",
});
}, 2000);
};
</script>
<template>
$END$
<view class="wrapper">
<image src="../../../static/wechat_login.jpg" />
<view class="logo">
<image :src="logoImg" />
<view>捷兑通</view>
</view>
<view class="center">
<nut-form :model-value="basicData" ref="RefForm">
<nut-form-item label="手机号码:">
<nut-input
v-model="basicData.phone"
class="nut-input-text"
placeholder="请输入手机号码"
type="text"
/>
</nut-form-item>
<nut-form-item label="验证码:">
<view style="display: flex">
<nut-input
v-model="basicData.code"
class="nut-input-text"
placeholder="请输入验证码"
type="text"
/>
<nut-button
size="mini"
style="margin-left: 10px"
@click="getSmsCode"
:disabled="smsDisabled"
>{{ smsStr }}</nut-button
>
</view>
</nut-form-item>
<nut-form-item>
<nut-button type="primary" block @click="login"
>登录</nut-button
>
</nut-form-item>
</nut-form>
</view>
</view>
</template>
<style scoped lang="scss">
<style lang="scss">
page {
background: #fff;
}
</style>
.wrapper {
position: relative;
image {
width: 100%;
height: 838px;
}
.logo {
position: absolute;
top: 35%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
font-size: 35px;
line-height: 70px;
image {
width: 200px;
height: 200px;
border-radius: 50%;
}
}
.center {
position: absolute;
top: 55%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
padding: 0px 10px;
}
}
</style>

View File

@@ -12,13 +12,13 @@
<view>{{ item.label }}</view>
</view>
</view>
<view style="width: 45%;"></view>
<view style="width: 45%"></view>
</view>
<!-- 二维码弹窗 -->
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="show">
<view class="popup">
<view>推荐人二维码绑定</view>
<image :src="urlCode" />
<image style="margin-top: 10px" :src="urlCode" />
</view>
</nut-popup>
</view>
@@ -28,6 +28,7 @@
import { ref } from "vue";
import { IconFont } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import { getRefereeCode } from "@/api/user";
const show = ref(false);
@@ -51,12 +52,19 @@ const list = ref([
},
]);
const clickItem = (item: any) => {
const clickItem = async (item: any) => {
if (item.id === 1) {
urlCode.value = `https://api.pwmqr.com/qrcode/create?url=${Taro.getStorageSync(
"token"
)}`;
// urlCode.value = `https://api.pwmqr.com/qrcode/create?url=${Taro.getStorageSync(
// "token"
// )}`;
Taro.showLoading({
title: "加载中",
mask: true,
});
const res = await getRefereeCode();
urlCode.value = `data:image/png;base64,${res.data.data}`;
show.value = true;
Taro.hideLoading();
} else if (item.id === 2) {
Taro.navigateTo({
url: "/pages/users/distribution/integral/index",

View File

@@ -9,7 +9,12 @@
<view class="left">
<view>昵称{{ item.nick_name }}</view>
<view>购买商品{{ item.goods_name }}</view>
<view>支付时间{{ item.add_time.slice(0, 10) }}</view>
<view
>订单价格<text style="color: red">{{
item.order_number
}}</text></view
>
<view>购买时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view style="color: red"

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '登录',
navigationStyle: 'custom'
})

View File

@@ -1,15 +1,89 @@
<script lang="ts">
import {defineComponent} from 'vue'
<script setup lang="ts">
import Taro from "@tarojs/taro";
import UserModal from "@/components/UserModal.vue";
import { ref } from "vue";
import logoImg from "../../../static/logo.jpg";
export default defineComponent({
name: "index"
})
const isShow = ref(false);
const getCode = () => {
Taro.showLoading({
title: "授权中...",
mask: true,
});
Taro.login({
success: (res) => {
console.log(res);
Taro.setStorageSync("wx_code", res.code);
isShow.value = true;
},
complete: () => {
Taro.hideLoading();
},
});
};
const toPage = () => {
Taro.navigateTo({
url: "/pages/users/bindPhone/index?type=1",
});
};
</script>
<template>
$END$
<view class="wrapper">
<image src="../../../static/wechat_login.jpg" />
<view class="logo">
<image :src="logoImg" />
<view>捷兑通</view>
</view>
<view class="center">
<nut-button type="success" @click="getCode">微信登录</nut-button>
<nut-button style="margin-top: 15px" @click="toPage"
>手机号登录</nut-button
>
</view>
<UserModal v-model:isShow="isShow" @closeEdit="isShow = false" />
</view>
</template>
<style scoped lang="scss">
<style lang="scss">
page {
background: #fff;
}
</style>
.wrapper {
position: relative;
image {
width: 100%;
height: 838px;
}
.logo {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
font-size: 35px;
line-height: 70px;
image {
width: 200px;
height: 200px;
border-radius: 50%;
}
}
.center {
position: absolute;
top: 80%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
padding: 10px 100px;
}
}
</style>

View File

@@ -6,6 +6,7 @@ import {
showToast,
navigateTo,
setStorageSync,
useDidShow,
} from "@tarojs/taro";
import Pay from "@/components/Pay.vue";
import { getIntegralOrderList } from "@/api/user";
@@ -63,6 +64,9 @@ const orderList = ref<OrderList[]>([]);
useLoad((options) => {
tabValue.value = Number(options.type);
});
useDidShow(() => {
getList();
});
@@ -205,10 +209,10 @@ const getTj = async () => {
<view class="center">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods.name }} </view>
<view class="title">{{ item.BindGoods?.name }} </view>
<view class="right">
<view>{{ item.number }}</view>
<view>x{{ item.count }}</view>
<view>{{ item.BindGoods?.number }}</view>
<view>x{{ item?.count }}</view>
</view>
</view>
<!-- <view

View File

@@ -16,12 +16,12 @@
<view class="mer-info">
<view class="left">
<view>
<text>{{ goodInfo.BindStore.name }}</text>
<text>{{ goodInfo.BindStore.phone }}</text>
<text>{{ goodInfo.BindStore?.name }}</text>
<text>{{ goodInfo.BindStore?.phone }}</text>
</view>
<nut-ellipsis
:rows="2"
:content="goodInfo.BindStore.address"
:content="goodInfo.BindStore?.address"
direction="end"
></nut-ellipsis>
</view>
@@ -43,12 +43,12 @@
<nut-cell>
<template #default>
<view class="top">
<image :src="goodInfo.BindGoods.cover" />
<image :src="goodInfo.BindGoods?.cover" />
<view class="title"
>{{ goodInfo.BindGoods.name }}
>{{ goodInfo.BindGoods?.name }}
</view>
<view class="right">
<view>{{ goodInfo.number }}</view>
<view>{{ goodInfo.BindGoods?.number }}</view>
<view>x{{ goodInfo.count }}</view>
</view>
</view>
@@ -57,15 +57,13 @@
<nut-cell title="订单号:" :desc="goodInfo.oid"></nut-cell>
<nut-cell
title="下单时间:"
:desc="goodInfo.add_time.slice(0, 19)"
:desc="goodInfo.add_time?.slice(0, 19)"
></nut-cell>
<nut-cell
v-if="goodInfo.expires !== 0"
title="商品过期时间:"
title="订单过期时间:"
:desc="
dayjs
.unix(goodInfo.expires)
.format('YYYY-MM-DD HH:mm:ss')
dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss')
"
></nut-cell>
<nut-cell

View File

@@ -31,6 +31,11 @@ const formValue = ref<any>({
back: [],
head_photo: [],
img: [],
bank: "",
bank_card: "",
bank_name: "",
bank_user: "",
address: "",
});
const merGooList = ref([]);
@@ -78,13 +83,18 @@ const onOk = async () => {
front: formValue.value.front[0]?.url,
back: formValue.value.back[0]?.url,
head_photo: formValue.value.head_photo[0]?.url,
img: formValue.value.img.map((item: any) => item.url),
img: formValue.value.img.map((item: any) => item.url).join(","),
};
const res = await applyMer(data);
Taro.showToast({
title: res.msg,
icon: "none",
});
setTimeout(() => {
Taro.redirectTo({
url: "/pages/index/index",
});
}, 3000);
} catch (e) {
Taro.showToast({
title: e.msg,
@@ -243,6 +253,91 @@ const submit = () => {
</nut-button>
</view>
</nut-form-item>
<nut-form-item
required
label="店铺地址"
prop="address"
:rules="[
{
required: true,
message: '请输入店铺详细地址',
},
]"
>
<input
type="text"
v-model="formValue.address"
placeholder="请输入店铺详细地址"
/>
</nut-form-item>
<nut-form-item
required
label="法人"
prop="bank_user"
:rules="[
{
required: true,
message: '请输入法人',
},
]"
>
<input
type="text"
v-model="formValue.bank_user"
placeholder="请输入法人"
/>
</nut-form-item>
<nut-form-item
required
label="账户名称"
prop="bank_name"
:rules="[
{
required: true,
message: '请输入账户名称',
},
]"
>
<input
type="text"
v-model="formValue.bank_name"
placeholder="请输入账户名称"
/>
</nut-form-item>
<nut-form-item
required
label="开户银行"
prop="bank"
:rules="[
{
required: true,
message: '请输入银行名称',
},
]"
>
<input
type="text"
v-model="formValue.bank"
placeholder="请输入银行名称"
/>
</nut-form-item>
<nut-form-item
required
label="银行卡号"
prop="bank_card"
:rules="[
{
required: true,
message: '请输入银行卡号',
},
]"
>
<input
type="text"
v-model="formValue.bank_card"
placeholder="请输入银行卡号"
/>
</nut-form-item>
<nut-form-item
required
label="商户类型"

View File

@@ -22,6 +22,7 @@ const logOut = () => {
if (res.confirm) {
Taro.removeStorageSync("token");
Taro.removeStorageSync("userInfo");
Taro.removeStorageSync("mer_type");
Taro.reLaunch({
url: "/pages/index/index",
});
@@ -34,7 +35,7 @@ const logOut = () => {
const chooseavatar = (e: any) => {
Taro.uploadFile({
url: `${BASE_URL}/app/upload`,
url: `${BASE_URL}/upload`,
filePath: e.detail.avatarUrl,
name: "file",
header: {

BIN
src/static/contact.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/static/def_avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,139 @@
@font-face {
font-family: "iconfont"; /* Project id 4211210 */
src: url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100') format('woff2'),
url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff?t=1692081500100') format('woff'),
url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.ttf?t=1692081500100') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-H:before {
content: "\e609";
}
.icon-indent:before {
content: "\e618";
}
.icon-outdent:before {
content: "\e620";
}
.icon-image:before {
content: "\e63f";
}
.icon-shanchu:before {
content: "\e74b";
}
.icon-formatheader1:before {
content: "\e860";
}
.icon-zitishangbiao:before {
content: "\e65c";
}
.icon-zitixiabiao:before {
content: "\e65d";
}
.icon-direction-rtl:before {
content: "\e6de";
}
.icon-fengexian:before {
content: "\e62d";
}
.icon-clearformat:before {
content: "\e60b";
}
.icon-redo:before {
content: "\e627";
}
.icon-undo:before {
content: "\e633";
}
.icon-font:before {
content: "\eae6";
}
.icon-font-colors:before {
content: "\e7f7";
}
.icon-font-size:before {
content: "\e7f8";
}
.icon-Character-Spacing:before {
content: "\e964";
}
.icon-duanhouju:before {
content: "\e61a";
}
.icon-duanqianju:before {
content: "\e61b";
}
.icon-line-height:before {
content: "\e7c4";
}
.icon-juzhongduiqi:before {
content: "\e621";
}
.icon-wuxupailie:before {
content: "\e63e";
}
.icon-youduiqi:before {
content: "\e64b";
}
.icon-youxupailie:before {
content: "\e64c";
}
.icon-zitijiacu:before {
content: "\e656";
}
.icon-zitishanchuxian:before {
content: "\e657";
}
.icon-zitixiahuaxian:before {
content: "\e658";
}
.icon-zitixieti:before {
content: "\e659";
}
.icon-zuoyouduiqi:before {
content: "\e65a";
}
.icon-zuoduiqi:before {
content: "\e65b";
}
.icon-fontbgcolor-copy:before {
content: "\eae7";
}

File diff suppressed because it is too large Load Diff

BIN
src/static/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/static/wechat_login.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,26 +1,20 @@
import { showToast, navigateBack } from "@tarojs/taro";
// 经纬度计算距离
export function calculateDistance(
lat1: number,
lon1: number,
lat2: number,
lon2: number
): string {
const R = 6371; // 地球平均半径(单位:千米)
const dLat = toRadians(lat2 - lat1);
const dLon = toRadians(lon2 - lon1);
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(toRadians(lat1)) *
Math.cos(toRadians(lat2)) *
Math.sin(dLon / 2) *
Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c;
return distance.toFixed(2);
la1: number,
lo1: number,
la2: number,
lo2: number
): any {
var radLat1 = la1 * Math.PI / 180.0;
var radLat2 = la2 * Math.PI / 180.0;
var a = radLat1 - radLat2;
var b = lo1 * Math.PI / 180.0 - lo2 * Math.PI / 180.0;
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
s = s * 6378.137;
s = Math.round(s * 10000) / 10000;
return s.toFixed(2) + 'km'
}
// 将角度转换为弧度

18
src/utils/js_sdk/u-charts.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,6 @@
import Taro from "@tarojs/taro";
import Taro from '@tarojs/taro'
export const BASE_URL =
process.env.NODE_ENV === "development"
? "http://192.168.2.3:9000/app"
: "https://www.wanzhuanyongcheng.cn/app";
export const BASE_URL = process.env.TARO_APP_API
interface Res<T> {
code: number;
@@ -11,47 +8,47 @@ interface Res<T> {
msg: string;
}
type Method = "GET" | "POST" | "PUT" | "DELETE";
type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
const request = (
url: string,
data: object = {},
method: Method = "GET"
method: Method = 'GET'
): Promise<Res<any>> => {
return new Promise((resolve, reject) => {
Taro.showLoading({
title: "加载中...",
mask: true,
});
// Taro.showLoading({
// title: '加载中...',
// mask: true
// })
Taro.request({
url: BASE_URL + url,
data: data,
method: method,
header: {
"content-type": "application/json",
token: Taro.getStorageSync("token"),
'content-type': 'application/json',
token: Taro.getStorageSync('token') || ''
},
success: ({ data }) => {
Taro.hideLoading();
success: ({data}) => {
// Taro.hideLoading()
if (data.code !== 200) {
Taro.showToast({
title: data.msg,
icon: "none",
});
reject(data);
return;
icon: 'none'
})
reject(data)
return
}
resolve(data);
resolve(data)
},
fail: () => {
Taro.showToast({
title: "服务器异常",
icon: "none",
});
reject({ code: 1, msg: "服务器异常" });
},
});
});
};
title: '服务器异常',
icon: 'none'
})
reject({code: 1, msg: '服务器异常'})
}
})
})
}
export default request;
export default request