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

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>