This commit is contained in:
2023-08-15 13:29:52 +08:00
parent 433a4d8f3d
commit c081f0fc29
25 changed files with 1328 additions and 448 deletions

22
components.d.ts vendored
View File

@@ -7,19 +7,29 @@ export {}
declare module '@vue/runtime-core' {
export interface GlobalComponents {
Auth: typeof import('./src/components/Auth.vue')['default']
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
NutButton: typeof import('@nutui/nutui-taro')['Button']
NutCategory: typeof import('@nutui/nutui-taro')['Category']
NutCategoryPane: typeof import('@nutui/nutui-taro')['CategoryPane']
NutCell: typeof import('@nutui/nutui-taro')['Cell']
NutIcon: typeof import('@nutui/nutui-taro')['Icon']
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
NutEmpty: typeof import('@nutui/nutui-taro')['Empty']
NutForm: typeof import('@nutui/nutui-taro')['Form']
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
NutGrid: typeof import('@nutui/nutui-taro')['Grid']
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
NutInput: typeof import('@nutui/nutui-taro')['Input']
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutPrice: typeof import('@nutui/nutui-taro')['Price']
NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar']
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
NutTabbar: typeof import('@nutui/nutui-taro')['Tabbar']
NutTabbarItem: typeof import('@nutui/nutui-taro')['TabbarItem']
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
NutTabs: typeof import('@nutui/nutui-taro')['Tabs']
NutToast: typeof import('@nutui/nutui-taro')['Toast']
NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
Pay: typeof import('./src/components/Pay.vue')['default']
}
}

View File

@@ -79,6 +79,7 @@ const config = {
autoprefixer: {
enable: true,
config: {
}
},
cssModules: {

View File

@@ -18,7 +18,7 @@
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"dev:weapp": "npm run build: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",
@@ -36,46 +36,47 @@
"author": "",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@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-platform-weapp": "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-tt": "3.6.11",
"@tarojs/plugin-platform-swan": "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-h5": "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",
"@tarojs/plugin-html": "3.6.11",
"@tarojs/plugin-framework-vue3": "3.6.11",
"vue": "^3.2.40",
"@nutui/nutui-taro": "^4.0.4",
"@nutui/icons-vue-taro": "^0.0.9"
"pinia": "^2.1.6",
"vue": "^3.2.40"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@types/webpack-env": "^1.13.6",
"webpack": "^5.78.0",
"@tarojs/cli": "3.6.11",
"@tarojs/taro-loader": "3.6.11",
"@tarojs/webpack5-runner": "3.6.11",
"@tarojs/cli": "3.6.11",
"@types/node": "^18.15.11",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@vue/babel-plugin-jsx": "^1.0.6",
"@vue/compiler-sfc": "^3.2.40",
"babel-preset-taro": "3.6.11",
"css-loader": "3.4.2",
"eslint-plugin-vue": "^8.0.0",
"eslint-config-taro": "3.6.11",
"eslint": "^8.12.0",
"stylelint": "9.3.0",
"eslint-config-taro": "3.6.11",
"eslint-plugin-vue": "^8.0.0",
"style-loader": "1.3.0",
"vue-loader": "^17.0.0",
"@typescript-eslint/parser": "^5.20.0",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"stylelint": "9.3.0",
"ts-node": "^10.9.1",
"typescript": "^4.1.0",
"unplugin-vue-components": "^0.23.0",
"ts-node": "^10.9.1",
"@types/node": "^18.15.11"
"vue-loader": "^17.0.0",
"webpack": "^5.78.0"
}
}

48
pnpm-lock.yaml generated
View File

@@ -56,6 +56,9 @@ dependencies:
'@tarojs/taro':
specifier: 3.6.11
version: 3.6.11(postcss@8.4.27)(vue@3.2.40)
pinia:
specifier: ^2.1.6
version: 2.1.6(typescript@4.1.2)(vue@3.2.40)
vue:
specifier: ^3.2.40
version: 3.2.40
@@ -112,6 +115,9 @@ devDependencies:
stylelint:
specifier: 9.3.0
version: 9.3.0
taro-plugin-pinia:
specifier: ^1.0.0
version: 1.0.0
ts-node:
specifier: ^10.9.1
version: 10.9.1(@swc/core@1.3.23)(@types/node@18.15.11)(typescript@4.1.2)
@@ -4315,6 +4321,10 @@ packages:
- whiskers
dev: true
/@vue/devtools-api@6.5.0:
resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==}
dev: false
/@vue/reactivity-transform@3.2.40:
resolution: {integrity: sha512-HQUCVwEaacq6fGEsg2NUuGKIhUveMCjOk8jGHqLXPI2w6zFoPrlQhwWEaINTv5kkZDXKEnCijAp+4gNEHG03yw==}
dependencies:
@@ -10906,6 +10916,24 @@ packages:
resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
engines: {node: '>=6'}
/pinia@2.1.6(typescript@4.1.2)(vue@3.2.40):
resolution: {integrity: sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==}
peerDependencies:
'@vue/composition-api': ^1.4.0
typescript: '>=4.4.4'
vue: ^2.6.14 || ^3.3.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
typescript:
optional: true
dependencies:
'@vue/devtools-api': 6.5.0
typescript: 4.1.2
vue: 3.2.40
vue-demi: 0.14.5(vue@3.2.40)
dev: false
/pinkie-promise@2.0.1:
resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==}
engines: {node: '>=0.10.0'}
@@ -13121,6 +13149,10 @@ packages:
postcss-value-parser: 3.3.1
dev: true
/taro-plugin-pinia@1.0.0:
resolution: {integrity: sha512-Ip2LTRh7NGsFyEzkZWvU115xDqV3D8cRRbqqw0JKTvzHFBzpwycmrUVQQxV61AMg0r2RJm3mcEbQ997j7xNjtg==}
dev: true
/terser-webpack-plugin@5.3.9(@swc/core@1.3.23)(esbuild@0.14.54)(webpack@5.78.0):
resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==}
engines: {node: '>= 10.13.0'}
@@ -13428,7 +13460,6 @@ packages:
resolution: {integrity: sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
/ufo@1.2.0:
resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==}
@@ -13852,6 +13883,21 @@ packages:
acorn-walk: 8.2.0
dev: true
/vue-demi@0.14.5(vue@3.2.40):
resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
peerDependencies:
'@vue/composition-api': ^1.0.0-rc.1
vue: ^3.0.0-0 || ^2.6.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
dependencies:
vue: 3.2.40
dev: false
/vue-eslint-parser@8.3.0(eslint@8.12.0):
resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}

View File

@@ -1,15 +1,15 @@
{
"miniprogramRoot": "./dist",
"projectname": "taroApp",
"description": "",
"appid": "wx3d814a9b985f6cab",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"compileHotReLoad": false,
"postcss": false,
"minified": false
},
"compileType": "miniprogram"
"miniprogramRoot": "./dist",
"projectname": "taroApp",
"description": "",
"appid": "wxdd00d46fa6f07974",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"compileHotReLoad": false,
"postcss": false,
"minified": false
},
"compileType": "miniprogram"
}

View File

@@ -1,34 +1,78 @@
export default defineAppConfig({
pages: [
'pages/index/index',
'pages/category/index',
'pages/cart/index',
'pages/user/index'
"pages/index/index",
"pages/category/index",
"pages/cart/index",
"pages/user/index",
],
subPackages: [
{
root: "pages/users",
pages: [
"order_list/index",
"setting/index",
"user_setting/index",
"settled_mer/index",
"order_list_detail/index",
],
},
{
root: "pages/goods",
pages: [
"goods_detail/index",
"order_create/index",
"order_status/index",
],
},
{
root: "pages/admin",
pages: ["verify/index"],
},
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff",
navigationBarTitleText: "WeChat",
navigationBarTextStyle: "black",
},
tabBar: {
color: "#666666",
selectedColor: "#ff0000",
backgroundColor: "#ffffff",
borderStyle: 'white',
list: [{
pagePath: 'pages/index/index',
text: '首页',
}, {
pagePath: 'pages/category/index',
text: '分类',
}, {
pagePath: 'pages/cart/index',
text: '购物车',
}, {
pagePath: 'pages/user/index',
text: '我的',
}]
}
})
borderStyle: "white",
list: [
{
pagePath: "pages/index/index",
iconPath: "static/tabbar/1-001.png",
selectedIconPath: "static/tabbar/1-002.png",
text: "首页",
},
{
pagePath: "pages/category/index",
iconPath: "static/tabbar/2-001.png",
selectedIconPath: "static/tabbar/2-002.png",
text: "分类",
},
{
pagePath: "pages/cart/index",
iconPath: "static/tabbar/3-001.png",
selectedIconPath: "static/tabbar/3-002.png",
text: "购物车",
},
{
pagePath: "pages/user/index",
iconPath: "static/tabbar/4-001.png",
selectedIconPath: "static/tabbar/4-002.png",
text: "我的",
},
],
},
permission: {
"scope.userLocation": {
desc: "你的位置信息将用于小程序位置接口的效果展示",
},
},
requiredBackgroundModes: ["audio", "location"],
// @ts-ignore
requiredPrivateInfos: ["getLocation"],
});

View File

@@ -0,0 +1,27 @@
@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;
}
.app {
box-sizing: border-box;
background-color: #f5f5f5;
height: 100vh;
position: relative;
// 适配ios底部安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}

View File

@@ -1,9 +1,14 @@
import { createApp } from 'vue'
import './app.scss'
import { createApp } from "vue";
import { createPinia } from 'pinia'
import "./app.scss";
const App = createApp({
onShow (options) {},
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
})
onLaunch() {},
onShow() {},
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
});
export default App
App.use(createPinia())
export default App;

View File

@@ -1,44 +0,0 @@
<script lang="ts" setup>
import {Cart, Category, Home, My} from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro';
import {computed} from "vue";
const prop = defineProps({
value: {
type: String,
default: "1"
},
})
let tabIndex = computed({
get() {
return prop.value
},
set(val) {
console.log(val)
// prop.value = val
}
})
const tabSwitch = (e) => {
console.log(e)
Taro.switchTab({
url: e.href
})
}
</script>
<template>
<view>
<nut-tabbar bottom placeholder safe-area-inset-bottom @tab-switch="tabSwitch" v-model="tabIndex">
<nut-tabbar-item tab-title="首页" :icon="Home" name="1" href="/pages/index/index"></nut-tabbar-item>
<nut-tabbar-item tab-title="分类" :icon="Category" name="2" href="/pages/category/index"></nut-tabbar-item>
<nut-tabbar-item tab-title="购物车" :icon="Cart" name="3" href="/pages/cart/index"></nut-tabbar-item>
<nut-tabbar-item tab-title="我的" :icon="My" name="4" href="/pages/user/index"></nut-tabbar-item>
</nut-tabbar>
</view>
</template>
<style lang="scss">
</style>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '首页'
navigationBarTitleText: '购物车'
})

View File

@@ -1,45 +1,35 @@
<template>
<view class="index">
<view>
<nut-empty description="购物车暂无数据">
<!-- <nut-button icon="refresh" type="primary" @click="toPage()">去兑换商品</nut-button>-->
</nut-empty>
<view>
<img src="" alt="">
<view style="height: 100px"></view>
</view>
{{ msg }} <Dongdong />
<view class="btn">
<nut-button type="primary" @click="handleClick('text', msg2, true)">点我</nut-button>
<view class="bottom-box">
<view class="left">
<nut-checkbox v-model="checkbox">全选</nut-checkbox>
<view class="text-box">
总计积分
<nut-price :price="0" size="normal" :need-symbol="false"/>
</view>
</view>
<nut-button type="primary">去结算</nut-button>
</view>
<nut-toast :msg="msg2" v-model:visible="show" :type="type" :cover="cover"/>
</view>
</template>
<script>
import { reactive, toRefs } from 'vue';
import { Dongdong } from '@nutui/icons-vue-taro';
export default {
name: 'Index',
components: {
Dongdong
},
setup() {
const state = reactive({
msg: '欢迎使用 NutUI4.0 开发小程序',
msg2: '你成功了~',
type: 'text',
show: false,
cover: false
});
<script lang="ts" setup>
import {ref} from 'vue';
import Taro from '@tarojs/taro'
const handleClick = (type, msg, cover = false) => {
state.show = true;
state.msg2 = msg;
state.type = type;
state.cover = cover;
};
const checkbox = ref(false)
return {
...toRefs(state),
handleClick
}
}
const toPage = () => {
Taro.switchTab({
url: '/pages/index/index'
})
}
</script>
@@ -50,4 +40,31 @@ export default {
-moz-osx-font-smoothing: grayscale;
text-align: center;
}
.bottom-box {
box-sizing: border-box;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100px;
z-index: 999;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
box-shadow: 100px 104px 288px rgba(0, 0, 0, 0.01);
.left {
display: flex;
align-items: center;
.text-box {
margin-left: 10px;
}
}
}
</style>

View File

@@ -1,59 +1,16 @@
<template>
<view class="app">
<nut-tabs style="height:100vh" v-model="val" title-scroll name="tab4value" direction="vertical">
<nut-tab-pane v-for="item in 10" :pane-key="item" :title="'Tab '+ item"> Tab {{item}} </nut-tab-pane>
</nut-tabs>
</view>
<nut-tabs style="height:100vh" v-model="val" title-scroll name="tab4value" direction="vertical">
<nut-tab-pane v-for="item in 10" :title="'Tab '+ item"> Tab {{ item }}</nut-tab-pane>
</nut-tabs>
</template>
<script lang="ts" setup>
import {ref, onMounted} from 'vue';
const val = ref('0')
const category = ref([
{
catId: 1,
catName: '手机',
},
{
catId: 2,
catName: '电脑',
},
{
catId: 3,
catName: '家电',
},
{
catId: 4,
catName: '生活',
},
{
catId: 5,
catName: '服饰',
}
])
const categoryChild = ref([
{
catId: 1,
catName: '休闲零食',
},
{}
])
const change = (e: any) => {
console.log(e)
}
const onChange = (e) => {
console.log(e)
}
const val = ref('0');
</script>
<style lang="scss">
.app {
height: 100vh;
}
</style>

View File

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

View File

@@ -1,144 +1,225 @@
<template>
<view class="app">
<nut-searchbar v-model="searchValue" placeholder="要搜索点什么?"></nut-searchbar>
<nut-swiper :init-page="0" :pagination-visible="true" pagination-color="#426543" auto-play="3000">
<nut-swiper-item v-for="(itm,idx) in swiperList" :key="idx">
<img :src="itm.url" :alt="itm.id"/>
</nut-swiper-item>
</nut-swiper>
<!-- <nut-tabs v-model="tabvalue" background="#fff" title-scroll title-gutter="10" name="0" :auto-height="true">-->
<!-- <nut-tab-pane title="精选推荐">-->
<!-- </nut-tab-pane>-->
<!-- <nut-tab-pane title="夏日防嗮"></nut-tab-pane>-->
<!-- <nut-tab-pane title="人气热榜"></nut-tab-pane>-->
<!-- </nut-tabs>-->
<view class="goodBox">
<view class="good" v-for="item in 5">
<image
src="https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png?imageMogr2/thumbnail/564x564/quality/70/strip/format/webp"
/>
<view class="good-text-box">
<text class="good-text">白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙</text>
<view class="good-price-box">
<text class="good-text-price"><text style="font-size: 20px">188</text>积分</text>
<Cart size="20" color="#ff0000" @click="addCart()"/>
</view>
<view class="app">
<!-- 搜索 -->
<nut-searchbar
v-model="searchValue"
placeholder="要搜索点什么?"
></nut-searchbar>
<!-- 幻灯片 -->
<nut-swiper
:init-page="0"
:pagination-visible="true"
pagination-color="#426543"
auto-play="3000"
>
<nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx">
<img :src="itm.url" :alt="itm.id.toString()" />
</nut-swiper-item>
</nut-swiper>
<!-- 金刚区 -->
<view class="navbar">
<nut-grid :gutter="10" :border="false">
<nut-grid-item
v-for="item in userMenuList"
:key="item.id"
:text="item.label"
@click="toPage(item.url)"
>
<image :src="item.icon" />
</nut-grid-item>
</nut-grid>
</view>
<!-- 标题 -->
<view class="titleImg">为你推荐</view>
<!-- 商品列表 -->
<view class="goodBox">
<view
class="good"
v-for="item in 5"
:key="item"
@click.stop="toGoodDetails(item)"
>
<image
src="https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png?imageMogr2/thumbnail/564x564/quality/70/strip/format/webp"
/>
<view class="good-text-box">
<text class="good-text"
>白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙</text
>
<view class="good-price-box">
<text class="good-text-price">
<text style="font-size: 20px">188</text>
积分
</text>
<Cart size="20" color="#ff0000" @click.stop="addCart()" />
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import {Cart} from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro';
import { ref } from "vue";
import { Cart } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
const searchValue = ref("")
const tabvalue = ref("0")
const searchValue = ref("");
// const tabvalue = ref("0");
const swiperList = ref([
{
id: 1,
url: "https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg"
},
{
id: 2,
url: "https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg"
},
{
id: 3,
url: "https://storage.360buyimg.com/jdc-article/welcomenutui.jpg"
},
{
id: 4,
url: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg"
}])
{
id: 1,
url: "https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg",
},
{
id: 2,
url: "https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg",
},
{
id: 3,
url: "https://storage.360buyimg.com/jdc-article/welcomenutui.jpg",
},
{
id: 4,
url: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
},
]);
const userMenuList = ref([
{
id: 1,
label: "活动游戏",
url: "",
icon: "http://jdt168.com/uploads/merchant/20220829/caad6be8983e88c41d28da7d124bc37b.png",
},
{
id: 2,
label: "活动商品",
url: "",
icon: "http://jdt168.com/uploads/def/20230509/d59e7fcb65a88bc56694dae4f9d21b51.png",
},
{
id: 3,
label: "商户入驻",
url: "/pages/users/settled_mer/index",
icon: "http://jdt168.com/uploads/merchant/20220829/6fe67b93721a42aedc842c4f19d6f2d3.png",
},
{
id: 4,
label: "最新资讯",
url: "",
icon: "http://jdt168.com/uploads/merchant/20220829/b975136a9b64aab69bf11d75a194f1ea.png",
},
]);
const addCart = () => {
Taro.showToast({
title: '加入购物车成功',
icon: 'success',
duration: 2000
})
}
Taro.showToast({
title: "加入购物车成功",
icon: "success",
duration: 2000,
});
};
const toPage = (url: string) => {
Taro.navigateTo({
url: url,
});
};
const toGoodDetails = (item: number) => {
Taro.navigateTo({
url: `/pages/goods/goods_detail/index?id=${item}`,
});
};
</script>
<style lang="scss">
.app {
box-sizing: border-box;
background-color: #f5f5f5;
}
.nut-swiper-item {
//line-height: 150px;
//padding: 20px;
box-sizing: border-box;
background-color: #f5f5f5;
}
.nut-swiper-item img {
width: 100%;
height: 350px;
//border-radius: 10px;
width: 100%;
height: 350px;
}
.titleImg {
margin-top: 10px;
width: 100%;
height: 50px;
box-sizing: border-box;
background-image: url("../../static/index/index-title.png");
background-repeat: no-repeat;
background-position: center;
background-size: 50%;
text-align: center;
line-height: 50px;
color: #ff0000;
font-weight: bold;
}
.navbar {
background-color: #ffffff;
image {
width: 80px;
height: 80px;
}
}
.goodBox {
//width: 100%;
//height: 100%;
margin-top: 5px;
display: flex;
padding: 20px;
flex-wrap: wrap;
justify-content: space-between;
display: flex;
padding: 20px;
flex-wrap: wrap;
justify-content: space-between;
.good {
width: 340px;
//height: 540px;
background-color: #fff;
margin-bottom: 10px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
.good {
width: 340px;
background-color: #fff;
margin-bottom: 20px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
image {
width: 100%;
height: 350px;
}
.good-text-box {
padding: 10px;
.good-text {
flex-shrink: 0;
font-size: 28px;
color: #333;
font-weight: 400;
display: -webkit-box;
height: 72px;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
line-height: 36px;
}
.good-price-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.good-text-price {
font-size: 28px;
font-weight: bold;
color: #ff0000;
//font-weight: 400;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
image {
width: 100%;
height: 350px;
}
}
}
}
.good-text-box {
padding: 10px;
.good-text {
flex-shrink: 0;
font-size: 28px;
color: #333;
font-weight: 400;
display: -webkit-box;
height: 72px;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
line-height: 36px;
}
.good-price-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.good-text-price {
font-size: 28px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
</style>

View File

@@ -1,4 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '个人中心',
navigationStyle: 'custom',
navigationStyle: 'custom'
})

View File

@@ -1,169 +1,327 @@
<template>
<view class="app">
<view 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">小明</view>
<view class="user-center-card__header__info__desc">这个人很懒什么都没有留下</view>
</view>
</view>
<!--我的订单-->
<view class="cell-card">
<view class="top">
<view>我的订单</view>
<view class="sub">
<view>全部订单</view>
<ArrowRight/>
<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="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">小明</view>
<view class="user-center-card__header__info__desc"
>ID:{{ 1 }}</view
>
</view>
<view class="rightIcon">
<Setting @click="toSetting" size="22" />
</view>
</view>
</view>
<view class="center">
<view class="center-t">
<Order size="25px"/>
<view class="center-text">待付款</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="center-t">
<Clock size="25px"/>
<view class="center-text">待使用</view>
</view>
<view class="center-t">
<Shop size="25px"/>
<view class="center-text">已使用</view>
</view>
<view class="center-t">
<Del size="25px"/>
<view class="center-text">已失效</view>
</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" />
<view class="center-text">待付款</view>
</view>
<view class="center-t" @click="toOrderList(2)">
<Clock size="25px" />
<view class="center-text">待使用</view>
</view>
<view class="center-t" @click="toOrderList(3)">
<Shop size="25px" />
<view class="center-text">已使用</view>
</view>
<view class="center-t" @click="toOrderList(4)">
<Del size="25px" />
<view class="center-text">已失效</view>
</view>
</view>
</view>
<!-- 我的服务 -->
<!-- 我的服务 -->
<view class="user-center">
<view>我的服务</view>
<view class="box">
<view
class="box-mini"
v-for="item in userMenuList"
:key="item.id"
>
<!-- <image :src="item.icon" /> -->
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
</view>
</view>
<view class="user-center">
<view>我的服务</view>
<view class="box">
<view class="box-mini" v-for="item in 10">
<image src="http://jdt168.com/uploads/def/20230612/890553361077384e0c1b1d9e164e2feb.png"/>
<view>我的账户</view>
<!-- 商家管理 -->
<view class="mer-box">
<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>
</view>
<!-- 登录 -->
<Auth :visible="isShowLogin" @update:visible="cancelLogin" />
</view>
</view>
</template>
<script lang="ts" setup>
import {reactive, toRefs} from 'vue';
import {ArrowRight, Order, Del, Clock, Shop} from '@nutui/icons-vue-taro';
import { ref } from "vue";
import {
ArrowRight,
Order,
Del,
Clock,
Shop,
Setting,
IconFont,
} from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import Auth from "../../components/Auth.vue";
const isShowLogin = ref(false);
const isLogin = ref(false);
// const userInfo = ref({});
Taro.useLoad(() => {
const token = Taro.getStorageSync("token");
if (token) {
isLogin.value = true;
}
});
const cancelLogin = () => {
isShowLogin.value = false;
};
const toOrderList = (e: number) => {
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/account/index",
icon: "http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png",
},
{
id: 4,
label: "关注商家",
url: "/pages/users/account/index",
icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
},
{
id: 5,
label: "问题反馈",
url: "/pages/users/account/index",
icon: "http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png",
},
]);
const toSetting = () => {
Taro.navigateTo({
url: "/pages/users/setting/index",
});
};
const clickLogin = () => {
isShowLogin.value = true;
};
const toPage = (url: string) => {
Taro.navigateTo({
url: url,
});
};
</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;
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__transparent {
position: absolute;
left: 30px;
top: 200px;
background-color: transparent;
//height: 100%;
width: 100%;
display: flex;
//flex-direction: row;
align-items: center;
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;
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;
}
}
.container {
position: absolute;
top: 350px;
width: 710px;
}
.cell-card {
box-sizing: border-box;
position: absolute;
top: 350px;
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;
.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: 20px;
}
.center-text {
margin-top: 20px;
}
}
}
}
}
.user-center {
box-sizing: border-box;
position: absolute;
top: 640px;
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
width: 710px;
.box {
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
width: 710px;
box-sizing: border-box;
margin-top: 20px;
display: flex;
//justify-content: space-between;
flex-wrap: wrap;
.box-mini {
display: flex;
flex-direction: column;
align-items: center;
width: 150px;
margin-bottom: 20px;
margin-right: 13px;
.box {
margin-top: 20px;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
image {
width: 80px;
height: 80px;
}
.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;
}
image {
width: 80px;
height: 80px;
}
}
}
}
}
.mer-box {
box-sizing: border-box;
background-color: #fff;
border-radius: 20px;
margin: 20px;
//padding: 30px;
width: 710px;
}
</style>

View File

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

View File

@@ -0,0 +1,274 @@
<script lang="ts" setup>
import {ref} from "vue";
import Taro from "@tarojs/taro";
import Pay from "../../../components/Pay.vue";
const tabValue = ref(0);
const isShowPay = ref(false);
const tabsList = ref([
{
title: "全部",
value: 0,
num: 3,
},
{
title: "待付款",
value: 1,
num: 0,
},
{
title: "待使用",
value: 2,
num: 1,
},
{
title: "已使用",
value: 3,
num: 1,
},
{
title: "已失效",
value: 4,
num: 1,
},
]);
const orderList = ref([{}]);
Taro.useLoad((options) => {
tabValue.value = Number(options.type);
});
const tabChange = (index: number) => {
tabValue.value = index;
};
Taro.useReachBottom(() => {
console.log("useReachBottom");
});
const openPay = () => {
console.log("openPay");
isShowPay.value = true;
};
const errPay = () => {
isShowPay.value = false;
Taro.showToast({
title: "支付失败",
icon: "none",
});
};
const closePay = () => {
isShowPay.value = false;
Taro.showToast({
title: "支付取消",
icon: "none",
});
};
</script>
<template>
<view>
<view class="topTips">
<view>
<view style="font-weight: bold">订单信息</view>
<view style="font-size: 15px"
>消费订单{{ 10 || 0 }} 总消费积分{{ 12312 || 0 }}
</view
>
</view>
<image src="../static/user/order_list_top.png"/>
</view>
<view class="tabs-box">
<view
v-for="item in tabsList"
:key="item.value"
@click="tabChange(item.value)"
>
<view class="text">{{ item.title }}</view>
<view>{{ item.num }}</view>
<view
class="line"
:class="{ lineColor: item.value === tabValue }"
></view>
</view>
</view>
<view v-if="orderList.length > 0">
<view class="order-card" v-for="item in 10" :key="item">
<view class="top">
<view>2023-08-14 14:24:23</view>
<view style="color: red">待付款</view>
</view>
<view class="line"></view>
<view class="center">
<view class="top">
<image src="../static/user/order_list_top.png"/>
<view class="title"
>商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称
</view
>
<view class="right">
<view>123.00</view>
<view>x1</view>
</view>
</view>
<view
class="bom"
style="text-align: right; font-size: 13px"
>
共10件商品,实付积分:
<text style="color: red"
>123.00
</text
>
</view>
</view>
<view class="line"></view>
<view class="btn">
<nut-button plain size="small" type="primary"
>取消订单
</nut-button
>
<nut-button
style="margin-left: 5px"
size="small"
type="primary"
>查看详情
</nut-button
>
<nut-button
style="margin-left: 5px"
size="small"
type="primary"
@click="openPay()"
>立即付款
</nut-button
>
</view>
</view>
</view>
<nut-empty v-else description="暂无订单"></nut-empty>
<pay
:isShowPay="isShowPay"
payType="wx"
@errPay="errPay"
@closePay="closePay"
/>
</view>
</template>
<style lang="scss">
page {
background-color: #f5f5f5;
}
scroll-view {
// IOS安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.topTips {
box-sizing: border-box;
width: 100%;
background-color: #ff0000;
color: #ffffff;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
image {
width: 150px;
height: 150px;
}
}
.tabs-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: auto;
background-color: #fff;
padding: 0 20px;
text-align: center;
.text {
margin: 10px 20px;
align-items: center;
}
.line {
margin: 0 auto;
width: 50px;
height: 5px;
border-radius: 30px;
transition: all 0.3s ease-in-out;
}
.lineColor {
background-color: #ff0000;
}
}
.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;
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
.top {
display: flex;
justify-content: space-between;
align-items: center;
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,30 @@
<script lang="ts" setup>
import Taro from '@tarojs/taro'
const toPage = (url: string) => {
if (url === '1') return Taro.showToast({title: '暂未开放', icon: 'none'})
Taro.navigateTo({
url: url
})
}
</script>
<template>
<view class="app">
<nut-cell-group>
<nut-cell title="个人信息" is-link @click="toPage('/pages/users/user_setting/index')"></nut-cell>
<nut-cell title="关于我们" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="资质证明" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="协议规则" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="隐私设置" is-link @click="toPage('1')"></nut-cell>
</nut-cell-group>
</view>
</template>
<style lang="scss">
.app {
width: 100%;
height: 100vh;
background-color: #f5f5f5;
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '申请商户',
})

View File

@@ -0,0 +1,160 @@
<script lang="ts" setup>
import {reactive, ref} from "vue";
const basicData = reactive({
name: '',
age: '',
tel: '',
address: ''
});
const visible = ref(false);
const merType = ref(false);
const merGooType = ref(false);
const formValue = ref({
merName: '',
name: '',
phone: '',
merType: '',
merTypeStr: '',
merGooType: '',
merGooTypeStr: '',
});
const ruleForm = ref<any>(null);
const onOk = () => {
visible.value = false;
};
const open = () => {
console.log('open');
visible.value = true;
};
const confirmMerType = (e: any) => {
formValue.value.merTypeStr = e.selectedOptions[0].text;
formValue.value.merType = e.selectedOptions[0].value;
merType.value = false;
}
const confirmGooType = (e: any) => {
formValue.value.merGooTypeStr = e.selectedOptions[0].text;
formValue.value.merGooType = e.selectedOptions[0].value;
merGooType.value = false;
}
const submit = () => {
ruleForm.value.validate().then(({valid, errors}: any) => {
if (valid) {
console.log('success', formValue.value);
visible.value = true;
} else {
console.log('error submit!!', errors);
}
});
}
</script>
<template>
<view class="appBg">
<nut-form ref="ruleForm" class="form" :model-value="formValue">
<nut-form-item required label="商户名称" prop="merName" :rules="[{
required: true,
message: '请输入商户名称',
}]">
<input type="text" v-model="formValue.merName" placeholder="请输入商户名称"/>
</nut-form-item>
<nut-form-item required label="用户姓名" prop="name" :rules="[{
required: true,
message: '请输入用户姓名',
}]">
<input type="text" v-model="formValue.name" placeholder="请输入真实姓名"/>
</nut-form-item>
<nut-form-item required label="联系电话" prop="phone" :rules="[{
required: true,
message: '请输入正确的电话号码',
regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
}]">
<input type="number" :maxlength="11" v-model="formValue.phone" placeholder="请输入联系电话"/>
</nut-form-item>
<nut-form-item required label="商户类型" prop="merTypeStr" :rules="[{
required: true,
message: '请选择商户类型',
}]">
<input type="text" :disabled="true" v-model="formValue.merTypeStr" placeholder="请选择商户类型"
@click="merType = true"/>
<nut-popup position="bottom" v-model:visible="merType">
<nut-picker :columns="[{
text: '供应商',
value: '1'
},{
text: '兑换商',
value: '2'
}]" title="商户类型" @confirm="confirmMerType" @cancel="merType = false"></nut-picker>
</nut-popup>
</nut-form-item>
<nut-form-item required label="经营类目" prop="merGooTypeStr" :rules="[{
required: true,
message: '请选择经营类目',
}]">
<input type="text" :disabled="true" v-model="formValue.merGooTypeStr" placeholder="请选择经营类目"
@click="merGooType = true"/>
<nut-popup position="bottom" v-model:visible="merGooType">
<nut-picker :columns="[{
text: '酒吧',
value: '1'
},{
text: 'KTV',
value: '2'
},{
text: '餐饮',
value: '2'
},{
text: '娱乐',
value: '4'
},{
text: '其他',
value: '5'
}]" title="商户类型" @confirm="confirmGooType" @cancel="merGooType = false"></nut-picker>
</nut-popup>
</nut-form-item>
<view class="btn">
<nut-button block type="primary" round @click="submit()">提交</nut-button>
</view>
</nut-form>
<!-- 入驻协议弹窗 -->
<nut-dialog
no-cancel-btn
title="入驻协议"
ok-text="已阅读并且同意"
v-model:visible="visible"
@ok="onOk"
>
<view>入驻协议</view>
</nut-dialog>
</view>
</template>
<style lang="scss">
.appBg {
background-image: url("../../../static/merchantBg.jpg");
background-size: 100%;
background-color: #E93423;
height: 100vh;
background-repeat: no-repeat;
.form {
position: relative;
top: 300px;
.btn {
padding: 20px;
margin-top: 20px;
text-align: center;
}
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '个人资料',
})

View File

@@ -0,0 +1,94 @@
<script lang="ts" setup>
import Taro from '@tarojs/taro'
const toPage = (e: string) => {
}
const logOut = () => {
Taro.showModal({
title: '提示',
content: '确定退出登录吗?',
success: function (res) {
if (res.confirm) {
Taro.removeStorageSync('token')
Taro.removeStorageSync('userInfo')
Taro.reLaunch({
url: '/pages/index/index'
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
</script>
<template>
<view class="app">
<view class="user-card">
<view>管理我的账号</view>
<view class="avatar-card">
<view class="left">
<nut-avatar size="large">
<img
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
<view class="name">微信用户</view>
</view>
</view>
</view>
<nut-cell-group>
<nut-cell title="昵称" desc="微信用户" is-link></nut-cell>
<nut-cell title="ID" desc="1" is-link></nut-cell>
<nut-cell title="手机号码" desc="18888888888" is-link></nut-cell>
<nut-cell title="登录密码" desc="修改登录密码" is-link></nut-cell>
<nut-cell title="注销账号" desc="账号注销后不能恢复" is-link></nut-cell>
</nut-cell-group>
<view class="btn">
<nut-button block type="primary" @click="logOut">退出登录</nut-button>
</view>
</view>
</template>
<style lang="scss">
.user-card {
width: 100%;
background-color: #fff;
box-sizing: border-box;
margin: auto;
position: relative;
top: 10px;
padding: 30px;
.avatar-card {
background-color: rgba(255, 0, 0, 0.1);
margin: 20px auto;
border-radius: 20px;
border: 1px solid #ff0000;
display: flex;
align-items: center;
padding: 30px;
position: relative;
.left {
margin-left: 10px;
display: flex;
align-items: center;
position: relative;
justify-content: space-between;
.name {
margin-left: 10px;
}
}
}
}
.btn {
padding: 0 40px;
}
</style>

View File

@@ -20,8 +20,15 @@
"resolveJsonModule": true,
"typeRoots": [
"node_modules/@types"
],
"types": [
"@tarojs/components/vue3"
]
},
"include": ["./src", "./types", "components.d.ts"],
"include": [
"./src",
"./types",
"components.d.ts"
],
"compileOnSave": false
}