build(custom): 修正提交规范

This commit is contained in:
2023-11-09 19:49:24 +08:00
parent 76d57cea37
commit 29c1d4280f
105 changed files with 29374 additions and 18618 deletions

View File

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

View File

@@ -1,53 +1,46 @@
<template>
<view class="app">
<view
class="user-center-card__header__transparent"
v-if="isLogin"
:style="{ width: isLogin ? '100%' : '70%' }"
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"/>
<img :src="userInfo.avatarUrl" />
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view
class="user-center-card__header__info__name"
@click="toPage('/pages/users/user_setting/index')"
>{{ userInfo.nickName }}
</view
>
class="user-center-card__header__info__name"
@click="toPage('/pages/users/user_setting/index')"
>{{ userInfo.nickName }}
</view>
<view v-if="!userInfo.phone">
<nut-button
size="mini"
open-type="getPhoneNumber"
@getphonenumber="getphonenumber"
>点击绑定手机号
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"
/>
<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"
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 class="user-center-card__header__info__name" @click="clickLogin"
>点击立即登录
</view>
</view>
</view>
@@ -58,39 +51,39 @@
<view>我的订单</view>
<view class="sub" @click="toOrderList(0)">
<view>全部订单</view>
<ArrowRight/>
<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"
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"
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"
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"
name="http://article.biliimg.com/bfs/article/c4f4e069dddfa7104f794a46a759a7ed478b81ea.png"
size="40"
/>
<view class="center-text">已失效</view>
</view>
@@ -101,20 +94,24 @@
<view class="user-center">
<view>我的服务</view>
<view class="box">
<view
<template v-if="isLogin">
<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>
>
<!-- <image :src="item.icon" /> -->
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
</template>
<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>
@@ -124,31 +121,31 @@
<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')"
: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"
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')"
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"
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')"
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"
size="50"
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
></IconFont>
</nut-grid-item>
<!-- <nut-grid-item-->
@@ -168,23 +165,23 @@
</view>
<!-- 登录 -->
<Auth
:visible="isShowLogin"
@update:visible="cancelLogin"
@ok="getUserInfo"
: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;
@@ -195,57 +192,57 @@ interface UserInfo {
uid?: string;
}
const userInfo = ref<UserInfo>({})
const userInfo = ref<UserInfo>({});
Taro.useDidShow(() => {
const token = Taro.getStorageSync('token')
const token = Taro.getStorageSync("token");
if (token) {
getUserInfo()
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()
}
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
})
await getUserInfo()
}
code: e.detail.code,
});
await getUserInfo();
};
const toOrderList = (e: number) => {
if (!isLogin)
if (!isLogin.value)
return Taro.showToast({
title: '请先登录',
icon: 'none'
})
title: "请先登录",
icon: "none",
});
Taro.navigateTo({
url: `/pages/users/order_list/index?type=${e}`
})
}
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'
label: "我的账户",
url: "/pages/users/account/index",
icon: "http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png",
},
// {
// id: 2,
@@ -255,65 +252,65 @@ const userMenuList = ref([
// },
{
id: 3,
label: '我的推广',
url: '/pages/users/distribution/index',
icon: 'http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png'
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'
}
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'
})
}
url: "/pages/users/setting/index",
});
};
const clickLogin = () => {
// isShowLogin.value = true
Taro.redirectTo({
url: '/pages/users/login/index'
})
}
url: "/pages/users/login/index",
});
};
const toPage = (url: string) => {
Taro.navigateTo({
url: url
})
}
url: url,
});
};
const scanCode = () => {
Taro.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
scanType: ["qrCode"],
success: async (data) => {
try {
await bindParent({
uid: data.result
})
uid: data.result,
});
Taro.showToast({
title: '绑定成功',
icon: 'none'
})
title: "绑定成功",
icon: "none",
});
} catch (error) {
Taro.showToast({
title: error.msg,
icon: 'none'
})
icon: "none",
});
}
}
})
}
},
});
};
</script>
<style lang="scss">
@@ -457,7 +454,6 @@ const scanCode = () => {
color: #000000;
background-color: #fff;
height: 100%;
}
button::after {